AlterTableStudentADD(AddressVarchar(25),PhoneINT,EmailVarcha"/> AlterTableStudentADD(AddressVarchar(25),PhoneINT,EmailVarcha">
Home >Database >Mysql Tutorial >How can we add multiple columns to an existing MySQL table using a single command?
We can also add multiple columns to an existing table with the help of ALTER command. Its syntax is as follows -
Alter table table-name ADD (column-name1 datatype, column-name2 datatype,… column-nameN datatype);
In the following example, with the help of ALTER command, the "Address", "Phone" and "E-mail" columns Add to "Students" table'.
mysql> Alter Table Student ADD(Address Varchar(25), Phone INT, Email Varchar(20)); Query OK, 5 rows affected (0.38 sec) Records: 5 Duplicates: 0 Warnings: 0
The above is the detailed content of How can we add multiple columns to an existing MySQL table using a single command?. For more information, please follow other related articles on the PHP Chinese website!