OCP-1Z0-051-V9 02-39题
39. Evaluate the following command:?
CREATE TABLE employees
(employee_id????? NUMBER(2) PRIMARY KEY,?
last_name??????? VARCHAR2(25) NOT NULL,serif; font-size: 13.63px'>
department_id??? NUMBER(2)NOT NULL,serif; font-size: 13.63px'>
job_id?????????? VARCHAR2(8),serif; font-size: 13.63px'>
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:
CREATE OR REPLACE VIEW sales_staff_vu AS???
SELECT employee_id,last_name,job_id
FROM employees
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.
Answer: BD
答案解析:
如果硬要选两个,我觉得应该是BC
?
参考:
http://www.voidcn.com/article/p-wumknikm-bbu.html
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_01/server.112/e41084/statements_9014.htm#SQLRF55094
官方文档说明,
multitable INSERT
?不能用在视图上,故D是错误的。
Restrictions on Multitable Inserts?Multitable inserts are subject to the following restrictions:
再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!希望你也加入到我们人工智能的队伍中来!http://www.captainbed.net (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |