ocp-047-102 视图

102. Evaluate the following command: 
CREATE TABLE employees 
(employee_id NUMBER(2) PRIMARY KEY, 
last_name VARCHAR2(25) NOT NULL, 
department_id NUMBER(2),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: 
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 statements are true regarding the above view? (Choose all  that apply.) 
A. It allows you to insert details of all new staff into the EMPLOYEES table. 
B. It allows you to delete the details of the existing sales staff from the 
EMPLOYEES table. 
C. It allows you to update the job ids of the existing sales staff to any 
other job id in the EMPLOYEES table. 
D.It allows you to insert the IDs, last names and job ids of th e sales staff 
from the view if it is used in multitable INSERT statements. 

Answer: BD 

通过user_updatable_columns表能够查询到该表或者视图是否可更新。

SQL> select * from user_updatable_columns t where t.table_name='SALES_STAFF_VU';
 
OWNER                          TABLE_NAME                     COLUMN_NAME                    UPDATABLE INSERTABLE DELETABLE
------------------------------ ------------------------------ ------------------------------ --------- ---------- ---------
A                              SALES_STAFF_VU                 EMPLOYEE_ID                    YES       YES        YES
A                              SALES_STAFF_VU                 LAST_NAME                      YES       YES        YES
A                              SALES_STAFF_VU                 JOB_ID                         YES       YES        YES


D 翻译: 他允许你使用多行插入语句根据视图中的销售经理的ID, last name和job id去插入
解释: insert the IDs, last names and job ids of the sales staff from the view也就是说数据来自于视图,而不是向视图插入数据,所以这是允许的
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值