Oracle Database 12c SQL面试题:constraints约束
程序员文章站
2022-06-21 21:14:44
q6.which two statements are true regarding constraints (choose two)
a. a constraint is enforced onl...
q6.which two statements are true regarding constraints (choose two)
a. a constraint is enforced only for an insert operation on a table.
b. a foreign key cannot contain null values.
c. the column with a unique constraint can store nulls.
d. you can have more than one column in a table as part of a primary key.
correct answer: cd
对于 a 选项,foreign key 可以包含 null
对于 c 选项,constaint 在 delete,update 的时候也会应用。
对于 e 选项,not null 不能在表级别定义,只能在列级别定义。