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选项其实一样,也是不正确的。
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选项其实一样,也是不正确的。