create table students(stu_id char(8) not null unique,
stu_name char(20) not null,
stu_age smallint default 20,
stu_sex char(2),
stu_department char(30),
constraint stu_sex check(stu_sex in('男','女')));
遇到问题先查查帮助文档,里边有很多关于使用方法的例子,呵呵。
create table students(stu_id char(8) not null unique,
stu_name char(20) not null,
stu_age smallint default(20),
stu_sex char(2),
stu_department char(30),
constraint c2 check(stu_sex in('男','女')));