MySQL alter table statement is used to add a column, modify a column, drop a column, rename a column or rename a table.

This video tutorial demonstrates the following: use riim; Database changed

show tables; +—————-+ | Tables_in_riim | +—————-+ | employees | | sample | +—————-+ 2 rows in set (0.00 sec)

— add a column in employees table; alter table employees – add email varchar(40) – after lname; Query OK, 1 row affected (0.32 sec) Records: 1 Duplicates: 0 Warnings: 0

alter table employees – add contact varchar(11) after email, – add address varchar(50) after contact; Query OK, 1 row affected (0.27 sec) Records: 1 Duplicates: 0 Warnings: 0

alter table employees – modify address varchar(100); Query OK, 1 row affected (0.30 sec) Records: 1 Duplicates: 0 Warnings: 0

 alter table employees

– modify address varchar(100); Query OK, 1 row affected (0.30 sec) Records: 1 Duplicates: 0 Warnings: 0

alter table employees drop column bonus; Query OK, 1 row affected (0.27 sec) Records: 1 Duplicates: 0 Warnings: 0