Add column

MySQL Add column

Add column to MySQL table using alter syntax.

MySQL Add column syntax

ALTER TABLE table_name ADD COLUMN column_name datatype;

Add column example

ALTER TABLE `books` ADD COLUMN `stock` VARCHAR(2);

Output

table `books` altered.