To insert new column in a table we use ALTER query.
Syntax:
1 | alter table table_name add column_name data_type; |
For example, if we consider the table employee we can write the query as:
1 | mysql>alter table employee add city varchar(25) not null; |
by this query we see that a new column E_City has been added in table Employee.Further you can also insert values in column city by using update query.