增加一列到某列名后
alter table table_name add column_name int after column_name;
改变列名称
alter table table_name change old_column_name new_column_name int;
修改类型
alter table table_name modify column_name float;
删除列
alter table table_name drop column_name;
修改表名
alter table old_table_name rename new_table;
表结构的删除
drop table table_name(注意外键的情况) with check option
添加主键
alter table table_name add primary key(COLUMN1,COLUMN2);
删除主键
alter table table_name drop primary key;
添加约束
alter table table_name add unique(COLUMN_name);
删除约束
alter table table_name drop index column_name;
时间: 2024-10-14 05:18:38