39.Evaluate the following command:CREATE TABLE employees(employee_id NUMBER(2) PRIMARY KEY

本文探讨了在数据库中创建包含WITH CHECK OPTION的视图,分析了如何通过这样的视图进行数据的插入、更新和删除操作,并明确了这些操作的具体限制。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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:

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.
答案:BD
A:错误,department_id为not null,视图没有包括该列
B:正确
C:错误,由于有WITH CHECK OPTION选项,因此只能更新视图可以显示的数据,不能更新其他的行数据
D:这个有点不太明白,到底应该怎样翻译,如果说得是可以使用该试图作为多表插入的原数据给别的表插入,只是使用列的话那么就是正确的,
如果是在多表插入中,要给该视图插入的话,那么和A选项其实一样,也是不正确的。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值