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

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,使用视图中的数据插入)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值