Which of the following are correct syntax in SQL?
(A) UPDATE tablename SET attribute1=value1, attribute2=value2.......WHERE condition;
(B) UPDATE TABLE tablename SET attribute1=value1, attribute2=value2.......WHERE condition;
(C) ALTER tablename DROP attribute;
(D) ALTER TABLE tablename DROP attribute;
Which of the following are correct syntax in SQL?
(A) UPDATE tablename SET attribute1=value1, attribute2=value2.......WHERE condition;
(B) UPDATE TABLE tablename SET attribute1=value1, attribute2=value2.......WHERE condition;
(C) ALTER tablename DROP attribute;
(D) ALTER TABLE tablename DROP attribute;
Solution
The correct syntax for UPDATE is with no TABLE keyword, so (A) is correct.
The correct syntax for removing a column is . The ALTER TABLE keywords are required, so (D) is the valid statement among the given forms (the COLUMN keyword is optional in some systems such as MySQL).
(B): UPDATE is never followed by the keyword TABLE.
(C): ALTER must be followed by TABLE, so "ALTER tablename" is invalid.
Related questions:
2026: 24 May Shift 1
2025: 27 May Shift 2
2026: 23 May Shift 1