视图WITH CHECK OPTION

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/nns7450/article/details/80332170

对视图的DML操作和WITH CHECK OPTION

DQL:查询SELECT
DML:操纵INSERT UPDATE DELETE
DLL:定义CREATE
DCL:控制如授权、回滚

视图WITH CHECK OPTION:数据库禁止更改不包含在子查询里的行。

创建视图时的列数也有要求,如列数不符合就无法插入非空列。

视图的聚合函数列必须有一个别名,有聚合函数的视图是复杂视图,不能进行DML操作。

例题:

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.)
 
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

阅读更多

没有更多推荐了,返回首页