天天看點

OCP-1Z0-051 補充題庫 第45題 CREATE VIEW

一、原題

You work as a database administrator at ABC.com. You study the exhibit carefully.

Exhibit:

OCP-1Z0-051 補充題庫 第45題 CREATE VIEW

You want to create a SALE_PROD view by executing the following SQL statements:

    CREATE VIEW sale_prod

    AS SELECT p.prod_id, cust_id, SUM(quantity_sold) "Quantity" ,SUM(prod_list_price) "Price"

           FROM products p, sales s

           WHERE p.prod_id=s.prod_id

          GROUP BY p.prod_id, cust_id; 

Which statement is true regarding the execution of the above statement?

A. The view will be created and you can perform DML operations on the view

B. The view will not be created because the join statements are not allowed for creating a view

C. The view will not be created because the GROUP BY clause is not allowed for creating a view

D. The view will be created but no DML operations will be allowed on the view

答案: D

二、題目翻譯

你做為ABC.com的一個資料庫管理者,有一些表結構及其關系如下:

用下面的語句建立一個視圖SALE_PROD:

關于執行上面的語句,下面哪個說法是正确的?

A.視圖建立成功,并且可以在視圖進行DML操作。

B.視圖建立不成功,因為join不能用在建立視圖語句中。

C.視圖建立不成功,因為GROUP BY子句不能用在建立視圖語句中。

D.視圖建立成功,但是不能在視圖上進行DML操作。

三、題目解析

上面的視圖有兩張表join關聯,是複雜視圖,是以不能進行DML操作。

具體詳見聯機文檔:

    http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_8004.htm#SQLRF01504