ocp題庫:1Z0-051-001題
最新學訊:近期OCP認證正在報名中,因考試人員較多請盡快報名獲取最近考試時間,報名費用請聯系在線老師,甲骨文官方認證,報名從速!
我要咨詢ocp題庫:1Z0-051-001題:完整題庫請點擊這里聯系老師咨詢了解
View the Exhibit and examine the structure of the SALES, CUSTOMERS, PRODUCTS, and TIMES
tables.
The PROD_ID column is the foreign key in the SALES table, which references the PRODUCTS table.
Similarly, the CUST_ID and TIME_ID columns are also foreign keys in the SALES table referencing the
CUSTOMERS and TIMES tables, respectively.
Evaluate the following CREATE TABLE command:
CREATE TABLE new_sales(prod_id, cust_id, order_date DEFAULT SYSDATE)
AS
SELECT prod_id, cust_id, time_id
FROM sales;
Which statement is true regarding the above command?

A. The NEW_SALES table would not get created because the DEFAULT value cannot be specified in the
column definition.
B. The NEW_SALES table would get created and all the NOT NULL constraints defined on the specified
columns would be passed to the new table.
C. The NEW_SALES table would not get created because the column names in the CREATE TABLE
command and the SELECT clause do not match.
D. The NEW_SALES table would get created and all the FOREIGN KEY constraints defined on the
specified columns would be passed to the new table.
Answer: B
試題解析:
A答案:默認sysdate可以在列出被指定。
sh@TEST0924> CREATE TABLE new_sales(prod_id, cust_id, order_date DEFAULT SYSDATE) AS
2 SELECT prod_id, cust_id, time_id FROM sales;
Table created.
B答案:NULL約束會傳遞。由以下可以看出,not null是可以傳遞的。B正確
C答案:
由A中所見,此表是可以創建的,雖然字段名不一樣,但數據庫類型一樣,就可以創建表。C錯誤。
D答案:
由B第二種方法看出,僅僅只是傳遞了not null約束,而SALES_PRODUCT_FK,SALES_CUSTOMER_FK,SALES_TIME_FK這三個外鍵約束是沒有被傳遞的。