ocp試題解析:11g-1Z0-051-v9.02-034題
最新學訊:近期OCP認證正在報名中,因考試人員較多請盡快報名獲取最近考試時間,報名費用請聯系在線老師,甲骨文官方認證,報名從速!
我要咨詢ocp試題解析:11g-1Z0-051-v9.02-034題,完整題庫請點擊這里聯系老師咨詢了解
34. You created an ORDERS table with the following description:
name Null Type
ORD_ID NOT NULL NUMBER(2)
CUST_ID NOT NULL NUMBER(3)
ORD_DATE NOT NULL DATE
ORD_AMOUNT NOT NULL NUMBER (10,2)
You inserted some rows in the table. After some time, you want to alter the table by creating the
PRIMARY KEY constraint on the ORD_ID column. Which statement is true in this scenario?
A. You cannot have two constraints on one column.
B. You cannot add a primary key constraint if data exists in the column.
C. The primary key constraint can be created only at the time of table creation .
D. You can add the primary key constraint even if data exists, provided that there are no duplicate values.
Answer: D
試題解析:
A. 一個列上不能有兩個約束,錯誤,例如非空+唯一可以作用在一個列上。
B. 如果數據已經存在不能添加主鍵約束,錯誤,有數據存在,也可以插入主鍵約束,前提是數據沒有重復
C. 主鍵約束只有在表創建時才能被創建,錯誤。有了數據之后一樣可以增加,不一定只有在創建的時候加
D. 即使數據存在,如果沒有重復值,你能添加主鍵約束,正確。