I don't know how to add a new field to MYSQL? It doesn't matter. The following will teach you how to add new fields in MYSQL. I hope you will learn how to add new fields in MYSQL.
- Alter table 'samecity _ ALBUM 'change 'city' city 'varchar (255) character set latin1 COLLATE latin1_swedish_ci NOT NULL
- Alter table table_name ADD test4 ENUM ('y', 'n') not null Default 'y', add key (test4 );
- Add an enumerated field, which is not null. The default value is Y and is set as an index.
-
- Alter table supe_aa add ex tinyint (1) not null default '0 ';
-
- // 549830479 primary key
-
- Alter table tabelname add new_field_id int (5) unsigned default 0 not null auto_increment, add primary key (new_field_id); // add a new column 549830479
-
- Alter table t2 add d timestamp;
- Alter table infos add ex tinyint not null default '0'; // delete column 549830479
-
- Alter table t2 drop column c; // rename column 549830479
-
- Alter table t1 change a B integer;
- // Change the column type 549830479
-
- Alter table t1 change B bigint not null;
- Alter table infos change list tinyint not null default '0 ';
- // Rename table 549830479
-
- Alter table t1 rename t2; add index 549830479
-
- Mysql> alter table tablename change depno int (5) not null;
- Mysql> alter table tablename add index name (field name 1 [, field name 2…]);
- Mysql> alter table tablename add index emp_name (name); index 549830479 with primary keywords added
-
-
- Mysql> alter table tablename add primary key (id); add the index 549830479 with the unique restriction
-
- Mysql> alter table tablename add unique emp_name2 (cardnumber); delete an index 549830479
-
- Mysql> alter table tablename drop index emp_name; Modify table: 549830479
-
- Add field: 549830479
-
- Mysql> alter table table_name ADD field_name field_type; modify the original field name and type: 549830479
-
- Mysql> alter table table_name CHANGE old_field_name new_field_name field_type; Delete field: 549830479
-
- Mysql> alter table table_name DROP field_name;
The above is how MYSQL adds new fields.
Common MySQL auto-increment Fields
Mysql character encoding method
Statement for modifying fields in mysql
How to delete multiple tables in MySQL
Common MySQL auto-increment Fields