下列 CHECK 约束条件中哪个总是有效的?[ ]
A: CONSTRAINT gender_chk CHECK(gender IN (N'男',N'女'))
B: CONSTRAINT birthday_chk CHECK(birthday > GETDATE())
C: CONSTRAINT mark_chk CHECK(mark<560)
D: CONSTRAINT address_chk CHECK(address LIKE N'广州市%')
A: CONSTRAINT gender_chk CHECK(gender IN (N'男',N'女'))
B: CONSTRAINT birthday_chk CHECK(birthday > GETDATE())
C: CONSTRAINT mark_chk CHECK(mark<560)
D: CONSTRAINT address_chk CHECK(address LIKE N'广州市%')
举一反三
- 为表ReaderType的LimitNum字段添加检查约束,要求教该字段的值<3,正确的语句是 A: ALTER TABLE ReaderTypeADD CONSTRAINT CK_ReaderType_LimitNum check (LimitNum=3) B: ALTER TABLE ReaderTypeADD CONSTRAINT check (LimitNum<3) C: ALTER TABLE ReaderTypeADD CONSTRAINT CK_ReaderType_LimitNum (LimitNum<3) D: ALTER TABLE ReaderTypeADD CONSTRAINT CK_ReaderType_LimitNum check (LimitNum<3)
- 完整性约束命名子句( )用来对完整性约束条件命名。 A: CONSTRAINT B: PRIMARYKEY C: FOREIGNKEY D: CHECK
- 向现有学生(stu)表中的gender列,添加性别只能输入是'男'或'女'的约束。 alter table stu add constraint ck_gender ① (gender in ('男','女')) A: default B: check C: primary key D: unique
- 中国大学MOOC: Constraint CK_Stu_Sex Check(Ssex in (男,女))指定了一个缺省值约束,让性别默认为男
- 为表ReaderType的LimitNum字段添加检查约束,要求教师类型中该字段的值+3,正确的语句是 A: ALTER TABLE ReaderTypeADD CONSTRAINT CK_ReaderType_LimitNum check (LimitNum=LimitNum+3) B: ALTER TABLE ReaderTypeADD CONSTRAINT check (LimitNum=LimitNum+3) WHERE Typename='教师' C: ALTER TABLE ReaderTypeADD CONSTRAINT CK_ReaderType_LimitNum (LimitNum=LimitNum+3) WHERE Typename='教师' D: ALTER TABLE ReaderTypeADD CONSTRAINT CK_ReaderType_LimitNum check (LimitNum=LimitNum+3) WHERE Typename='教师'