We can remove, drop, or delete one or more columns in an existing table using the ALTER TABLE statement as follows:
ALTER TABLE table_name DROP COLUMN column_name1, column_name2….;
To delete columns in MySQL, you would typically use the ALTER TABLE
statement along with the DROP COLUMN
clause. Here’s the syntax:
ALTER TABLE table_name
DROP COLUMN column_name;
Replace table_name
with the name of your table and column_name
with the name of the column you want to delete. Make sure to execute this statement with caution as it permanently removes the specified column and its data from the table.