删除约束
alter table 表名
drop constraint 约束名
添加主键约束
alter table 表名
add constraint PK_主键字段 primary key(主键字段)
添加唯一键约束
alter table 表名
add constraint uQ_字段 unique (字段)
添加默认约束
alter table 表名
add constraint DF_字段 default ('默认值') for 字段
添加检查约束
alter table 表名
add constraint CK_字段 check (条件)
添加外键约束
alter table 表名
add constraint FK_外键字段 foreign key(外键字段) references 主键表(主键字段)
删除表
drop table tableName;
清除表中数据
truncate table tableName;