In mysql, you can use the [alter table old table name rename new table name;] statement to modify the table name, such as [mysql> alter table TYPE rename type;].
#The operating environment of this article: windows10 system, mysql 5.7, thinkpad t480 computer.
Mysql modification statement is as follows:
1. Modify table name
Usage: alter table old table name rename new table name;
mysql> alter table TYPE rename type;
2. Modify Column name of the table
Usage: alter table table name change old table name new table name type;
mysql> alter table type change name type_name varchar(30) not null;
3. Modify the type of a certain column of the table
Usage: alter table Table name modify column name type;
mysql> alter table type modify type_name varchar(100);
4. Add a column
Usage: alter table table name add column name type;
mysql> alter table type add age int(11);
5. Delete a column
Usage: alter table type drop column name;
mysql> alter table type drop age;
Free learning video sharing:mysql video tutorial
The above is the detailed content of mysql modify statement. For more information, please follow other related articles on the PHP Chinese website!