Add and modify fields in MySQL, and add fields in mysql
The method for adding fields in MySQL is not complex. The following describes how to add and modify fields in MYSQL. It is helpful for you to learn how to add fields in MySQL.
1. Add Table Fields
Alter table table1 add transactor varchar (10) not Null;
Alter table table1 add id int unsigned not Null auto_increment primary key
2. Modify the field type of a table and specify it as null or non-empty.
Alter table name change field Name field type [whether to allow non-null];
Alter table name modify Field Name field type [whether to allow non-null];
Alter table name modify Field Name field type [whether to allow non-null];
3. Modify the field name of a table and specify it as null or not
Alter table name change field Original Name field New Name field type [whether to allow non-null
4. to delete a field, run alter table mytable DROP field name;