How can we remove a column from MySQL table?

MySQLMySQLi Database

To drop a column from a MySQL table we can use ALTER TABLE command with DROP keyword. The syntax is as follows

Alter Table table_name DROP Column Column_name;

Below is an example to demonstrate it

mysql> Alter table student drop column class;
Query OK, 5 rows affected (0.34 sec)
Records: 5 Duplicates: 0 Warnings: 0

The query above will drop the column name ‘class’ from ‘student’ table.

Updated on 20-Jun-2020 05:57:16