1.修改表
#修改表名 alter table 旧表名 rename [TO] 新表名;
#添加字段 alter table 表名 add 字段名 数据类型 [属性];
#修改字段 alter table 表名 change 原字段名 新字段名 数据类型 [属性];
#删除字段 alter table 表名 drop 字段名;
2.添加主键
alter table '表名' add constraint '主键名' primary key '表名' ('主键字段');
3.添加外键
alter table '表名' add constraint 外键名 foreign key('外键字段') references '关联表名' ('关联字段');
转载请注明原文地址: https://ju.6miu.com/read-675319.html