签到成功

知道了

CNDBA社区CNDBA社区

oracle 1z-082 第2题

2022-08-14 22:46 1232 0 原创 oracle
作者: hbhe0316

2.Which two statements are true about views?
A.A view must only refer to tables in its defining query.
B.The WITH CHECK clause prevents certain rows from being displayed when querying the view
C.Views can be updated without the need to re-grant privileges on the view
D.The WITH CHECK clause prevents certain rows from being updated or inserted in the underlying table through the view.
E.Views can be indexed

http://www.cndba.cn/hbhe0316/article/108583
http://www.cndba.cn/hbhe0316/article/108583
http://www.cndba.cn/hbhe0316/article/108583http://www.cndba.cn/hbhe0316/article/108583
http://www.cndba.cn/hbhe0316/article/108583

SQL> create view view1 as select * from t1;
View created.
SQL> create view view2 as select * from view1;
View created.

SQL> create or replace view test1_view as select * from test1 where id < 5 with check option;

View created.

SQL> delete from test1;

2 rows deleted.

SQL> insert into test1_view values (1);

1 row created.

SQL> insert into test1_view values (20);
insert into test1_view values (20)
            *
ERROR at line 1:
ORA-01402: view WITH CHECK OPTION where-clause violation

SQL> select * from test1;

        ID
----------
         1

SQL> select * from test1_view;

        ID
----------
         1

答案:CDhttp://www.cndba.cn/hbhe0316/article/108583

A.VIEW也可以创建VIEW,所以A错误
B.WITH CHECK OPTION作用在 VIEW INSERT 或者UPDATE VIEW当中
C.不需要对VIEW重新授权,正确
D.正确
E.VIEW不能加Indexhttp://www.cndba.cn/hbhe0316/article/108583

http://www.cndba.cn/hbhe0316/article/108583
http://www.cndba.cn/hbhe0316/article/108583
http://www.cndba.cn/hbhe0316/article/108583

版权声明:本文为博主原创文章,未经博主允许不得转载。

oracle

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
hbhe0316

hbhe0316

关注

1.只有承认无知,才能装下新的东西; 2.进步来自一点点滴滴的积累; 3.广博让你更优秀,而专业让你无法替代; 4.挫折和失败能够转换为一种财富。

  • 889
    原创
  • 1
    翻译
  • 13
    转载
  • 24
    评论
  • 访问:1146687次
  • 积分:1523
  • 等级:核心会员
  • 排名:第6名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ