现有表t = {prof(职称),comn(津贴)}
添加约束: 限定教师的岗位津贴:教授必为3000,副教授2000,讲师1500,助教1000
alter table t
add constraint new_limit--添加 check() 约束
check
(
(prof = '教授' and comn = 3000)
or (prof = '副教授' and comn = 2000)--条件与条件之间用 or 连接
or (prof = '讲师' and comn = 1500)
or (prof = '助教'and comn = 1000)
);