How To Change Table Structure in MySQL

The ALTER TABLE statement is used to add, delete, or modify columns in an existing table. It is also used to add and drop various constraints on an existing table.

To add a column in a table,

ALTER TABLE table_name
ADD column_name datatype;

To delete a column in a table,

ALTER TABLE table_name
DROP COLUMN column_name;

To change the data type of a column in a table,

ALTER TABLE table_name
ALTER COLUMN column_name datatype;
Subscribe for Free Updates

Please enable the javascript to submit this form