38.Which two statements are true regarding views? (Choose two.)

38.Which two statements are true regarding views? (Choose two.)
A.A simple view in which column aliases have been used cannot be updated.
B.Rows cannot be deleted through a view if the view definition contains the DISTINCT keyword. 
C.Rows added through a view are deleted from the table automatically when the view is dropped.
D.The OR REPLACE option is used to change the definition of an existing view without dropping and re-creating it.
E.The WITH CHECK OPTION constraint can be used in a view definition to restrict the columns displayed through the view.
答案:BD
解析:
A:题目说的是一个简单视图中使用了列别名不能用于update,这个是错误的
SQL> create table test(a varchar2(10));


Table created.


SQL> create view v_test as select a as aa from test;


View created.


SQL> insert into test values ('1');


1 row created.


SQL> update v_test set aa='2';            


1 row updated.


SQL> select * from test;


A
----------
2


SQL> commit;


Commit complete.
B:正确,如果视图定义包含DISTINCT关键字,那么不能通过视图删除数据
C:错误,题目说的是通过视图增加的数据,当视图删除的时候数据自动删除,显然是不正确的
D:正确,or replace用于不需要删除就可以进行修改结构,他的最大好处是权限不需要处理
E:错误,这里说WITH CHECK OPTION的作用是是通过视图限制列的显示,这显然是不正确的,他的作用
是执行所有的dml语句只能符合该视图能查到的,也即是满足where条件的
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值