ITPub博客

首页 > 数据库 > Oracle > OCP 1Z0-051-39

OCP 1Z0-051-39

原创 Oracle 作者:LuiseDalian 时间:2014-05-12 07:02:22 0 删除 编辑
(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

答案:(B、D)

解析:

A(X),视图基表中有列未出现在视图中,且它具有NOT NULL约束。

C(X),因为具有WITH CHECK OPTION

D,关于多表插入

INSERT  ALL

   INTO sal_history VALUES(EMPID,HIREDATE,SAL)

   INTO mgr_history VALUES(EMPID,MGR,SAL)

   SELECT employee_id EMPID, hire_date HIREDATE,

                  salary SAL, manager_id MGR

   FROM  employees

   WHERE employee_id > 200;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/17013648/viewspace-1158774/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: OCP 1Z0-051-40
请登录后发表评论 登录
全部评论

注册时间:2012-02-06

  • 博文量
    1986
  • 访问量
    6040880