28. Which two statements are true regarding constraints? (Choose two.)
A. A foreign key cannot contain NULL values.
B. A column with the UNIQUE constraint can contain NULL values.
C. A constraint is enforced only for the INSERT operation on a table.
D. A constraint can be disabled even if the constraint column contains data.
E. All constraints can be defined at the column level as well as the table level.
Answer: BD
答案解析:
参考:http://blog.csdn.net/rlhua/article/details/12905109
A不对因为外键可以包含空值
C不对因为约束可以作用在INSERT,UPDATE,DELETE操作上
E不对因为NOT NULL约束只能在列级定义,不能在表级定义
B正确,唯一约束可以包含空值
D正确,即使约束列上有数据,也可以让约束不可用。

本文探讨了SQL中关于约束的两个正确陈述:唯一约束可以包含空值,以及即使约束列上有数据,约束也可以被禁用。文章澄清了一些常见的误解,并提供了详细的解释。

5442

被折叠的 条评论
为什么被折叠?



