1: Delete Columns
ALTER table "table name" DROP "column name"
2: Add columns
ALTER table "table name" ADD "column name" INT not NULL COMMENT ' comment description '
3: Modify the column type information
ALTER table "table name" Change "column Name" "New column name (you can use the same name as the original column)" BIGINT not NULL COMMENT ' comment description '
4: Renaming columns
ALTER table "table name" Change "column Name" "New column name" BIGINT not NULL COMMENT ' comment description '
5: Renaming a table
ALTER table "table name" RENAME "Table new name"
6: Delete primary key in table
Alter table "Tables name" Drop PRIMARY key
7: Add primary key
ALTER TABLE sj_resource_charges ADD CONSTRAINT pk_sj_resource_charges PRIMARY KEY (resid,resfromid)
8: Add index
ALTER TABLE sj_resource_charges Add index index_name (NAME);
9: Add a unique limit condition index
ALTER TABLE sj_resource_charges Add unique emp_name2 (cardnumber);
10: Delete Index
ALTER TABLE tablename DROP INDEX emp_name;
MySQL's alter statement usage summary