OCP-1Z0-051 补充题库 第45题 CREATE VIEW

一、原题
You work as a database administrator at ABC.com. You study the exhibit carefully.
Exhibit:


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

猜你喜欢

转载自blog.csdn.net/hollo_hhy/article/details/44861515