Difficulty: Easy
Correct Answer: ALTER TABLE TableName DROP COLUMN ColumnName
Explanation:
Introduction / Context:
Changing a table's structure is a Data Definition Language (DDL) task. Dropping a column must follow the DBMS's accepted ALTER TABLE syntax. Using a portable, standards-aligned form reduces surprises across platforms.
Given Data / Assumptions:
Concept / Approach:
The canonical form is ALTER TABLE ... DROP COLUMN ... . Many vendors also accept slight variations, but the explicit DROP COLUMN keyword pair is the most standard and clear. Always review constraints and foreign keys that reference the column before dropping.
Step-by-Step Solution:
Verification / Alternative check:
Most mainstream DBMS documentation (e.g., PostgreSQL, SQL Server, Oracle, MySQL) supports ALTER TABLE ... DROP COLUMN, sometimes with additional options (CASCADE, RESTRICT).
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
ALTER TABLE TableName DROP COLUMN ColumnName
Discussion & Comments