OCP 1Z0 051 39
来源:互联网 发布:知乎和百度贴吧 编辑:程序博客网 时间:2024/04/30 07:56
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.
因有非空列department_id不在view中,所以不能insert.
c这种情况前面讲过
D from the view,view做为源取数据?那insert到哪个表?
Answer: BD
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.
SQL> CREATE TABLE employees 2 (employee_id NUMBER(10) PRIMARY KEY, 3 last_name VARCHAR2(25) NOT NULL, 4 department_id NUMBER(10)NOT NULL, 5 job_id VARCHAR2(20), 6 salary NUMBER(10,2));Table createdSQL> insert into employees(employee_id,last_name,department_id,job_id,salary) 2 select employee_id,last_name,department_id,job_id,salary from hr.employees 3 WHERE department_id IS NOT NULL;106 rows insertedSQL> SQL> CREATE OR REPLACE VIEW sales_staff_vu AS 2 SELECT employee_id, last_name,job_id 3 FROM employees 4 WHERE job_id LIKE 'SA_%' 5 WITH CHECK OPTION;View createdSQL> select count(*) from sales_staff_vu; COUNT(*)---------- 34
因有非空列department_id不在view中,所以不能insert.
SQL> insert into sales_staff_vu values(35,'test','no job');insert into sales_staff_vu values(35,'test','no job')ORA-01400: 无法将 NULL 插入 ("TEST"."EMPLOYEES"."DEPARTMENT_ID")
SQL> delete from sales_staff_vu where rownum <=1;1 row deleted
c这种情况前面讲过
SQL> update sales_staff_vu set job_id = 'new job';update sales_staff_vu set job_id = 'new job'ORA-01402: 视图 WITH CHECK OPTION where 子句违规
D from the view,view做为源取数据?那insert到哪个表?
Answer: BD
0 0
- OCP 1Z0 051 39
- OCP 1Z0 051 QUESTION NO: 39
- OCP-1Z0-051-2015-39题
- OCP 1Z0 051 1
- OCP 1Z0 051 2
- OCP 1Z0 051 3
- OCP 1Z0 051 4
- OCP 1Z0 051 5
- OCP 1Z0 051 6
- OCP 1Z0 051 7
- OCP 1Z0 051 8
- OCP 1Z0 051 9
- OCP 1Z0 051 10
- OCP 1Z0 051 11
- OCP 1Z0 051 12
- OCP 1Z0 051 13
- OCP 1Z0 051 14
- OCP 1Z0 051 15
- popViewControllerAnimated时未调用viewWillAppear问题
- HDU 4268 Alice and Bob (set+贪心)
- ListView 创建及使用
- NSBundle
- Makefile使用函数
- OCP 1Z0 051 39
- jsp page指令详解
- 堆的节点总数n和叶结点数目的关系 (CLRS习题 6.1-7)
- ps创造冲击力震撼的动感效果教程
- /proc/config.gz文件
- 单短截线变换器==单支变换器 双短截线 单节变换器 多节变换器
- Android小应用-----画画板
- 第一章 从开机加电到执行main函数之前的过程 0000节
- Wayland helloworld (四)之窗口显示