标签:
检查约束用来限制列的取值范围
create table stu10
(id number,
sex char(4) check(sex=‘男‘ or sex=‘女‘),
age number
);
create table stu12
(id number,
sex char(4) check(sex=‘男‘ or sex=‘女‘),
age number constraint check_age1 check(age between 0 and 150)
);
create table stu13(
id number,sex char(4) ,
age number,
constraint check_sex check(sex=‘男‘ or sex=‘女‘)
);
alter table stu13 drop constraint check_sex ;
alter table stu13 add constraint check_sex check(sex=‘男‘ or sex=‘女‘)
标签:
原文地址:http://www.cnblogs.com/JSWBK/p/4979886.html