1. 程式人生 > >1Z0-051 35. Which two statements are true regarding constraints? (Choose two.)

1Z0-051 35. Which two statements are true regarding constraints? (Choose two.)

35. Which twostatements are true regarding constraints? (Choose two.)

A. A table canhave only one primary key and one foreign key.

B. A table canhave only one primary key but multiple foreign keys.

C. Only theprimary key can be defined at the column and table levels.

D. The foreignkey and parent table primary key must have the same name.

E. Both primarykey and foreign key constraints can be defined at both column and table levels.

答案: BE  一個表只可以有一個主鍵,但是可以有多個外來鍵。只有not null必須是列級約束,其他約束都可以做表級約束。

列級約束:carete   table    parent(c1 number  primary key); 

表級約束:create table child (c1  number primary key ,c2 number,constraint fk_c foreign key(c1)   references parent(c1));--
列都定義完後用逗號隔開,進行表級約束定義。