Altertablestudentmodif"/> Altertablestudentmodif">
By using the MODIFY keyword and the ALTER TABLE command, we can modify the columns of a MySQL table. The syntax is as follows;
Alter table table_name MODIFY column_name1 datatype, MODIFY column_name2 datatype… MODIFY column_nameN datatype);
In the following example, the "Address" and "Grade" columns are modified with the help of the MODIFY keyword in the ALTER command the size of.
mysql> Alter table student modify address varchar(45),Modify Grade Varchar(15); Query OK, 5 rows affected (0.38 sec) Records: 5 Duplicates: 0 Warnings: 0
The above is the detailed content of How do we modify columns of MySQL table?. For more information, please follow other related articles on the PHP Chinese website!