Assume a table 'GUARDIAN' having 4 columns viz. 'Guid', 'Gname', 'Gphone' and 'Gadd'. Which of the following command is correct for inserting a record into the table?
Assume a table 'GUARDIAN' having 4 columns viz. 'Guid', 'Gname', 'Gphone' and 'Gadd'. Which of the following command is correct for inserting a record into the table?
Solution
✅ Correct Option: 2
The correct SQL syntax is . When all columns are being filled, the column list can be left out, and the values must follow the column order: Guid, Gname, Gphone, Gadd. Option 2 follows this syntax exactly.
Option 1: the keyword VALUES is missing. Without it, the bracket would be read as a list of column names, and numbers and strings are not valid column names.
Options 3 and 4: the keyword INTO is missing. Option 4 also uses VALUE instead of VALUES.
Related questions:
2025: 15 May Shift 2
2025: 21 May Shift 1
2025: 22 May Shift 1