OCP-1Z0-051-2015-19题
2015-06-25 15:43
435 查看
Examine the structure of the EMPLOYEES table:
You want to create a SQL script file that contains an INSERT statement. When the script is run,
the INSERT statement should insert a row with the specified values into the EMPLOYEES table.
The INSERT statement should pass values to the table columns as specified below:
Which INSERT statement meets the above requirements?
A. INSERT INTO employees
VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
B. INSERT INTO employees
VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid',2000, NULL, &did IN (20,50));
C. INSERT INTO (SELECT *
FROM employees
WHERE department_id IN (20,50))
VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
D. INSERT INTO (SELECT *
FROM employees
WHERE department_id IN (20,50)
WITH CHECK OPTION)
VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
E. INSERT INTO (SELECT *
FROM employees
WHERE (department_id = 20 AND
department_id = 50)
WITH CHECK OPTION )
VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
Answer: D
Explanation:在EMPLOYEES 表中插入一条语句,首先字段1 employee_id为自增需要.nextval;字段5 department_id为20或者50所以需要department_id IN (20,50) WITH CHECK OPTION
Using the WITH CHECK OPTION Clause: Example The following statement is legal even though
the third value inserted violates the condition of the subquery
with check option可以这么解释:通过视图进行的修改,必须也能通过该视图看到修改后的结果。比如你insert,那么加的这条记录在刷新视图后必须可以看到;如果修改,修改完的结果也必须能通过该视图看到;如果删除,当然只能删除视图里有显示的记录。
You want to create a SQL script file that contains an INSERT statement. When the script is run,
the INSERT statement should insert a row with the specified values into the EMPLOYEES table.
The INSERT statement should pass values to the table columns as specified below:
Which INSERT statement meets the above requirements?
A. INSERT INTO employees
VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
B. INSERT INTO employees
VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid',2000, NULL, &did IN (20,50));
C. INSERT INTO (SELECT *
FROM employees
WHERE department_id IN (20,50))
VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
D. INSERT INTO (SELECT *
FROM employees
WHERE department_id IN (20,50)
WITH CHECK OPTION)
VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
E. INSERT INTO (SELECT *
FROM employees
WHERE (department_id = 20 AND
department_id = 50)
WITH CHECK OPTION )
VALUES (emp_id_seq.NEXTVAL, '&ename', '&jobid', 2000, NULL, &did);
Answer: D
Explanation:在EMPLOYEES 表中插入一条语句,首先字段1 employee_id为自增需要.nextval;字段5 department_id为20或者50所以需要department_id IN (20,50) WITH CHECK OPTION
Using the WITH CHECK OPTION Clause: Example The following statement is legal even though
the third value inserted violates the condition of the subquery
where_clause:
with check option可以这么解释:通过视图进行的修改,必须也能通过该视图看到修改后的结果。比如你insert,那么加的这条记录在刷新视图后必须可以看到;如果修改,修改完的结果也必须能通过该视图看到;如果删除,当然只能删除视图里有显示的记录。
相关文章推荐
- HTML5页面在安卓手机端分页显示数据
- HttpModule与HttpHandler详解
- Linux vim查找与替换操作及快捷键
- leetcode-19Remove Nth Node From End of List
- Android Studio SVN的安装与使用
- linux下的c/c++调试器gdb
- Chord算法(原理)
- 管理软件最新版本
- yii框架AR详解
- JS学习笔记之左边列表移到到右边列表
- 自行颁发不受浏览器信任的SSL证书
- Nmap扫描教程之DNS服务类
- cocos2dx 自动添加所有cpp文件到android.mk
- Unique Paths 算法详解
- php中安全模式safe_mode配置教程
- Agenda: June 24, 2015 2100 UTC
- 架构师之路(39)---IoC框架
- 读书笔记-于渊(一个操作系统的实现)一
- Codeforces Round#309 C Kyoya and Colored Balls
- 用HTML5实现鼠标滚轮事件放大缩小图片的功能