To update the datatype of an attribute in a table, which of the following syntax will be used?
To update the datatype of an attribute in a table, which of the following syntax will be used?
Solution
✅ Correct Option: 1
ALTER TABLE with MODIFY changes the definition of an existing column, including its datatype. For example, changes the datatype of marks to FLOAT.
Option 2: ADD inserts a new column into the table. It does not change an existing one.
Options 3 and 4: UPDATE and SET belong to the DML statement , which changes row values (data), not the table structure. They are not valid clauses of ALTER TABLE.
In MySQL and Oracle the clause is MODIFY, while SQL Server uses ALTER COLUMN.
Related questions:
2026: 29 May Shift 2
2025: 21 May Shift 1
2025: 15 May Shift 2
2026: 11 May Shift 2
2025: 16 May Shift 1