--添加主键alter table 表名 add constraint 主键名 primary key(字段名1,字段名2……);使用这种语句创建主键列,但主键名尽量不用列
缺少主键字段。示例:alter table user add primary key (id);