QUESTION 29
Which two statements are true regarding constraints? (Choose two.)
A. A foreign key cannot contain NULL values.
B. The column with a UNIQUE constraint can store NULLS .
C. A constraint is enforced only for an INSERT operation on a table.
Which two statements are true regarding constraints? (Choose two.)
A. A foreign key cannot contain NULL values.
B. The column with a UNIQUE constraint can store NULLS .
C. A constraint is enforced only for an INSERT operation on a table.
D. You can have more than one column in a table as part of a primary key.
答案:BD
ABC的解析查看QUESTION 28 ;
D选项正确,一个表可以有多个主键:
SQL> create table test (
2 id number(1),
3 t1 varchar2(20));
Table created.
SQL> alter table test add constraint pk_test primary key(id,t1);
Table altered.
本文探讨了数据库中约束的应用,包括NULL值处理、唯一性约束及主键设置等关键概念。指出外键可以包含NULL值,而唯一性约束允许NULL的存在,并说明了一个表可以拥有多个作为主键组成部分的列。
2357

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



