OCP 1Z0 051 QUESTION NO: 23
来源:互联网 发布:深度linux下载 编辑:程序博客网 时间:2024/06/16 17:26
QUESTION NO: 23
Evaluate this SQL statement:
SELECT e.emp_name, d.dept_name
FROM employees e
JOIN departments d
USING (department_id)
WHERE d.department_id NOT IN (10,40)
ORDER BY dept_name;
The statement fails when executed. Which change fixes the error?
A. remove the ORDER BY clause
B. remove the table alias prefix from the WHERE clause
C. remove the table alias from the SELECT clause
D. prefix the column in the USING clause with the table alias
E. prefix the column in the ORDER BY clause with the table alias
F. replace the condition
”d.department_id NOT IN (10,40)”
in the WHERE clause with
”d.department_id <> 10 AND d.department_id <> 40”
Answer: C,E
所以答案应该是B
Evaluate this SQL statement:
SELECT e.emp_name, d.dept_name
FROM employees e
JOIN departments d
USING (department_id)
WHERE d.department_id NOT IN (10,40)
ORDER BY dept_name;
The statement fails when executed. Which change fixes the error?
A. remove the ORDER BY clause
B. remove the table alias prefix from the WHERE clause
C. remove the table alias from the SELECT clause
D. prefix the column in the USING clause with the table alias
E. prefix the column in the ORDER BY clause with the table alias
F. replace the condition
”d.department_id NOT IN (10,40)”
in the WHERE clause with
”d.department_id <> 10 AND d.department_id <> 40”
Answer: C,E
DROP TABLE employees PURGE;CREATE TABLE employeesASSELECT e.first_name || '' || e.last_name AS emp_name, e.department_id FROM hr.employees e WHERE rownum <= 5;DROP TABLE departments PURGE;CREATE TABLE departments ASSELECT d.department_name AS dept_name, d.department_id FROM hr.departments d;当join中使用using子句时,using里出现的列,在整个查询中都不能加前缀。
所以答案应该是B
SQL> SELECT e.emp_name, d.dept_name 2 FROM employees e 3 JOIN departments d 4 USING (department_id) 5 WHERE d.department_id NOT IN (10, 40) 6 ORDER BY dept_name;SELECT e.emp_name, d.dept_name FROM employees e JOIN departments d USING (department_id) WHERE d.department_id NOT IN (10, 40) ORDER BY dept_nameORA-25154: column part of USING clause cannot have qualifier
SQL> SELECT e.emp_name, d.dept_name 2 FROM employees e 3 JOIN departments d 4 USING (department_id) 5 WHERE department_id NOT IN (10, 40) 6 ORDER BY dept_name;EMP_NAME DEPT_NAME--------------------------------------------- ------------------------------PatFay MarketingMichaelHartstein MarketingDouglasGrant ShippingDonaldOConnell Shipping4 rows selected
0 0
- OCP 1Z0 051 QUESTION NO: 23
- OCP 1Z0 051 QUESTION NO: 1
- OCP 1Z0 051 QUESTION NO: 2
- OCP 1Z0 051 QUESTION NO: 3
- OCP 1Z0 051 QUESTION NO: 4
- OCP 1Z0 051 QUESTION NO: 5
- OCP 1Z0 051 QUESTION NO: 6
- OCP 1Z0 051 QUESTION NO: 7
- OCP 1Z0 051 QUESTION NO: 8
- OCP 1Z0 051 QUESTION NO: 9
- OCP 1Z0 051 QUESTION NO: 10
- OCP 1Z0 051 QUESTION NO: 11
- OCP 1Z0 051 QUESTION NO: 12
- OCP 1Z0 051 QUESTION NO: 13
- OCP 1Z0 051 QUESTION NO: 14
- OCP 1Z0 051 QUESTION NO: 15
- OCP 1Z0 051 QUESTION NO: 16
- OCP 1Z0 051 QUESTION NO: 17
- 弘历
- Java学习推荐书目
- CentOs 设置静态IP 方法
- 11.Oracle之 dmp导入/导出、数据库操作等过程中的字符集问题
- javascript设计模式-----观察者模式
- OCP 1Z0 051 QUESTION NO: 23
- JavaScript在多浏览器下for循环的使用方法
- Android Bundle类
- 在线maven仓库
- PHP输入流php://input介绍
- 曼彻斯特编码器的vhdl实现代码
- Java系统资源使用分析工具;
- 二叉树的深度优先遍历
- 中华电信宣布4G正式启用 台湾进入4G时代