MySQL Delete Column

How to delete column or change column name?

Explanation

MySQL Delete column :
The DROP COLUMN is used to delete a column from the table.

Syntax :


ALTER TABLE tbl_name DROP col_name;
The following query drops the field marks.
MySQL Delete Column
Change a column name :
When we modify a column, we have to specify the attribute of the column again. The following example renames the name field to stud_name in the student table.
MySQL Delete Column
Change a column name :
If we want to change the attribute alone, we can use the same column as in the following example.
MySQL Delete Column


Ask Questions

Ask Question