像這樣用代碼寫約束。
alter table stu info add constraint CK _ stu sex check(stu sex = ' male '或' female ')
其中stuInfo是表名,stuSex是要設置約束的列名。