Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

205

积分

19

好友

29

主题
1#
发表于 2013-12-19 22:12:04 | 查看: 3318| 回复: 2
本帖最后由 biotwang 于 2013-12-19 22:18 编辑

39. Evaluate the following command:
  1.   CREATE TABLE employees(employee_id NUMBER(2) PRIMARY KEY,
  2.                          last_name VARCHAR2(25) NOT NULL,
  3.                          department_id NUMBER(2) NOT NULL,
  4.                          job_id VARCHAR2(8),
  5.                          salary NUMBER(10, 2));
复制代码
You issue the following command to create a view that displays the IDs and last names of the sales staff IN the organization:
  1. CREATE OR REPLACE VIEW sales_staff_vu AS
  2.   SELECT employee_id, last_name, job_id
  3.     FROM employees
  4.    WHERE job_id LIKE 'SA_%' WITH CHECK OPTION;
复制代码
Which two statements are true regarding the above view? (Choose two.)
A. It allows you to insert rows into the  EMPLOYEES table .
B. It allows you to delete details of the existing sales staff from the EMPLOYEES table.
C. It allows you to update job IDs of the existing sales staff to any other job ID in the EMPLOYEES table.
D. It allows you to insert IDs, last names, and job IDs of the sales staff from the view if it is used in multitable INSERT statements.

答案: BD

为什么选项D是正确的,实在找不出例子。希望有兴趣的看看:
2#
发表于 2013-12-25 13:29:50
A错误,因为employees表的department_id有非空约束,如果通过视图插入,则department_id列则为空,会报错。
B正确,可以通过视图来删除employees任意行。
C错误,因为有WITH CHECK OPTION,是根据job_id LIKE 'SA_%' 来创建的视图,所以不能更改为不是SA_开头的,但是可以更新为SA_开头的。
D错误,也是因为department_id有非空约束,如果通过视图插入,则department_id列则为空,会报错。
但是可以通过multitable INSERT在视图上插入,所有官方文档有错误?

参考:http://docs.oracle.com/cd/E11882 ... 9014.htm#SQLRF55094
官方文档说明,multitable INSERT 不能用在视图上,故D是错误的。


http://blog.csdn.net/rlhua/article/details/12792647

回复 只看该作者 道具 举报

3#
发表于 2013-12-26 15:02:54
这道题目在本次考试时又被抽到了。。纠结了下。
我也看了官方说明,不过考题确实很扯~~

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-5-17 17:18 , Processed in 0.045635 second(s), 20 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569