约束的定义

constraint c_a primary key clustered (id,cname)   --主键约束
constraint  pk_id  primary  key(id),

constraint c_b unique clustered (id,cname)    --唯一性约束
constraint  uk_identity  unique (cname)

constraint c_c check [NOT FOR REPLIACTION] (express)  --检查约束
SCORE NUMERIC(5,1) CONSTRAINT SCORE_CHK CHECK(SCORE>=0 AND SCORE <=100))

constraint c_d default express for column    --默认约束
constraint  con_dept  default  ‘计算机’  for  dept

constraint c_e foreign key (cname) references table[(bname)]--外键约束
CONSTRAINT S_FORE FOREIGN KEY REFERENCES S(SNO)

constraint c_d null not null --空值约束
SNO CHAR(10) CONSTRAINT S_CONS NOT NULL

你可能感兴趣的:(C++,c,C#)