1、创建表时添加检查约束
CREATE TABLE table_name (
column1 datatype CHECK (expressions),
...);
CREATE TABLE table_name(
column1 datatype,
column2 datatype,
CONSTARINT constraint_name CHECK (expressions),...);
2、修改表时添加检查约束
ALTER TABLE table_name(
ADD CONSTRAINT constraint_name CHECK (expression));
3、删除检查约束
ALTER TABLE table_name (
DISABLE |ENABLE CONSTRAINT constraint_name);
ALTER TABLE table_name (
DROP CONSTRAINT constraint_name);