您的位置:首页 > 其它

OCP-1Z0-051-题目解析-第39题

2014-06-29 18:46 316 查看
39. Evaluate the following command:  

CREATE TABLE employees 

(employee_id      NUMBER(2) PRIMARY KEY,  

last_name        VARCHAR2(25) NOT NULL,  

department_id    NUMBER(2)NOT NULL,  

job_id           VARCHAR2(8),  

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: 
(使用下面的命令创建一个视图,显示组织中销售人员的IDs和last names)

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 


A:可以通过视图插入数据到Employees表中(错误,department_id为非空约束,而视图中没有department_id,插入会报错)

B:它允许你从Employees表中删除已存在员工的详细信息 (正确)

C:它允许你把已存在员工的job ID 更新为任意的job ID (错误,由于存在WITH CHECK OPTION,所以更新后的job id 必须以SA_开头)

D:如果使用多表插入语句,它允许你使用视图中的IDs, last names, and job插入(正确,注意,这个选项不是向视图中插入数据,是from the view,使用视图中的数据插入)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息