How to Delete a Column from a Table in SQL
The correct command to delete the 'Category' column from the 'Products' table is:
D. Alter table products drop column category
Explanation:
- ALTER TABLE is the SQL command used to modify the structure of an existing table.
- DROP COLUMN is the clause used to remove a column from the table.
Incorrect Options:
- A. Alter table products delete column category: The keyword 'delete' is not used to remove columns, it's used for deleting rows.
- B. Alter table delete column category from product: This command is syntactically incorrect. The 'from' keyword is not used in this context.
原文地址: https://www.cveoy.top/t/topic/nwQp 著作权归作者所有。请勿转载和采集!