Which of the following command is used to add/remove a column or to modify its datatype inside a table?
Which of the following command is used to add/remove a column or to modify its datatype inside a table?
Solution
ALTER TABLE changes the structure of an existing table. It can add a column (ADD), remove a column (DROP COLUMN), or change a column's datatype (MODIFY or ALTER COLUMN, depending on the DBMS).
Drop: removes a whole table or database object. It is used inside ALTER only as DROP COLUMN, so on its own it cannot add a column or modify a datatype.
Update: changes the data (values) in existing rows, not the table structure.
Set: not a standalone command here. It only assigns values inside an UPDATE statement.
Related questions:
2026: 18 May Shift 2
2026: 26 May Shift 1
2025: 22 May Shift 1
2026: 21 May Shift 1
2026: 11 May Shift 2