check约束

create table student
(
stu_id int primary key,
stu_sal int check (stu_sal>=1000 and stu_sal<=12000)

)
insert into student values(1,1000)
insert into student values(2,10000)

保证事物的取值在合法的范围之内

posted @ 2026-04-20 22:31  菜鸟的奋斗军  阅读(8)  评论(0)    收藏  举报