--primary key主键--唯一,不能为空,有唯一索引
--foreign key外键--与其他表主键间的约束
--unique --唯一约束
--check 检查约束,自定义字段数据的范围或规则
--not null 非空约束
create table a
(
c1 int,
c2 char not null,
c3 char(1) check(t3 in('a','b','c'),
constraint pk_a primary key(c1),
constraint fk_a foreign key (c2) references b(b1)
);
/*Oracle添加约束*/
最新推荐文章于 2023-05-11 12:55:26 发布