添加主键:
alter table 表名 add constraint 主键名
primary key 表名 (主键字段);
添加外键:
alter table 表名 add constraint 外键名
foreign key(外键字段)
reference 关联表名 (关联字段);
插入单条数据记录语法:
insert into 表名 [(字段名列表)] values (值列表);
修改表名:alter table 旧表名 rename [to] 新表名
添加字段:alter table 表名 add 字段名 数据类型 [属性];
修改字段:alter table 表名 change 原字段名 新字段名 数据类型 [属性];
删除字段:alter table 表名 drop 字段名;
插入多条数据语录:
insert into 新表 (字段名列表)
values (值列表1),(值列表2)......(值列表n);
更新数据语录:
update 表名
set 字段 1=值1,字段2=值2,.....字段n=值n
【where 条件】