一、原题

View the Exhibit to examine the description for the SALES table.
Which views can have all DML operations performed on it? (Choose all that apply.)
 ocp-051-2_ocp-051-2
A. CREATE VIEW v3
AS SELECT * FROM SALES
WHERE cust_id = 2034
WITH CHECK OPTION;

B. CREATE VIEW v1
AS SELECT * FROM SALES
WHERE time_id <= SYSDATE - 2*365
WITH CHECK OPTION;

C. CREATE VIEW v2
AS SELECT prod_id, cust_id, time_id FROM SALES
WHERE time_id <= SYSDATE - 2*365
WITH CHECK OPTION;

D. CREATE VIEW v4
AS SELECT prod_id, cust_id, SUM(quantity_sold) FROM SALES
WHERE time_id <= SYSDATE - 2*365
GROUP BY prod_id, cust_id
WITH CHECK OPTION;

答案 AB

二、题目翻译

下图是SALES表的描述。
可以在哪一个视图上面执行所有的DML操作?(选择所有正确的项)


三、题目解析

WITH CHECK OPTION选项:Oracle数据库禁止更改不包含在子查询条件里的行。
C不正确的是因为,视图只建了三列,而其它列不能为空,
D不正确的是因为聚合函数SUM(quantity_sold)需要一个别名,并且有聚合函数就是复杂视图,复杂视图是不能进行DML操作的。