为表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: 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)
举一反三
- 为表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='教师'
- 以下哪条命令用于删除一个约束()。 A: Alter TABLE MODIFY CONSTRAINT B: Drop CONSTRAINT C: Alter TABLE Drop CONSTRAINT D: Alter CONSTRAINT Drop
- 要建立一个约束,保证用户表()中年龄()必须在16岁以上,下面语句正确的是()。 A: alter<br/>table user add constraint ck_age CHECK(age>16) B: alter<br/>table user add constraint df_age DEFAULT(16) for age C: alter<br/>table user add constraint uq_age UNIQUE(age>16) D: alter<br/>table user add constraint df_age DEFAULT(16)
- 要建立一个约束,保证用户表()中年龄()必须在16岁以上,下面语句正确的是_________。 A: alter table user<br/>add constraint df_age DEFAULT(16) for age B: alter table user<br/>add constraint ck_age CHECK(age>16) C: alter table user<br/>add constraint uq_age UNIQUE(age>16) D: alter table user<br/>add constraint df_age DEFAULT(16)
- 为salerecord表GID字段添加外键,引用goods表中GID字段。 A: ALTER TABLE salerecord ADD CONSTRAINT pk2 PRIMARY KEY(GID) REFERENCES goods(GID); B: ALTER TABLE salerecord ADD CONSTRAINT fk2 FOREIGN KEY(GID) REFERENCES goods(GID); C: ALTER TABLE salerecord ADD CONSTRAINT fk2 FOREIGN KEY(CID) REFERENCES goods(CID); D: ALTER TABLE salerecord ADD CONSTRAINT pk2 PRIMARY KEY(CID) REFERENCES goods(CID);