【OCP-12c】CUUG最新考试原题整理及答案(071-10)
10、(5-6) choose the best answer:
Examine the structure of the EMPLOYEES table:
There is a parent/child relationship between EMPLOYEE_ID and MANAGER_ID.
You want to display the name, joining date, and manager for all the employees.
Newly hired employees are yet to be assigned a department or a manager. For them, 'No Manager' should be displayed in the MANAGER column.
Which SQL query gets the required output?
A) SELECT e.last_name, e.hire_date, NVL(m.last_name, 'No Manager') Manager
FROM employees e RIGHT OUTER JOIN employees m
ON (e. manager_id = m.employee_id);
B) SELECT e.last_name, e.hire_date, NVL(m.last_name, 'No Manager') Manager
FROM employees e JOIN employees m
ON (e.manager_id = m.employee_id);
C) SELECT e.last_name, e.hire_date, NVL(m.last_name, 'No Manager') Manager
FROM employees e LEFT OUTER JOIN employees m
ON (e.manager_id = m.employee_id);
D) SELECT e.last_name, e.hire_date, NVL(m.last_name, 'No Manager') Manager
FROM employees e NATURAL JOIN employees m
ON (e.manager_id = m.employee_id);
Answer:C
(解析:因为员工 king 是没有经理的,但是也要显示出来,因为是在经理号这边缺少数据,所以这里要用
左外连接。注意左右的区别:
SELECT e.last_name, e.hire_date, NVL(m.last_name, 'No Manager') Manager
FROM employees e , employees m
WHERE e.manager_id = m.employee_id(+);
)
【OCP-12c】CUUG最新考试原题整理及答案(071-10)的更多相关文章
- 【OCP-12c】CUUG最新考试原题整理及答案(071-11)
11.(5-8) choose the best answer: Examine the structure of the BOOKS_TRANSACTIONS table. You want to ...
- 【OCP-12c】CUUG最新考试原题整理及答案(071-12)
12.(5-12)choose two:Examine the data in the CUSTOMERS table:You want to list all cities that have mo ...
- 【OCP-12c】CUUG最新考试原题整理及答案(071-9)
9.(5-5) choose the best answerView the Exhibit and examine the structure of the SALES and STORES tab ...
- OCP 12c最新考试原题及答案(071-8)
8.(5-4) choose the best answer:You need to produce a report where each customer's credit limit has b ...
- OCP 12c最新考试原题及答案(071-7)
7.(5-1) choose two:View the Exhibit and examine the structure of the PRODUCTS table.Which two tasks ...
- OCP 12c最新考试原题及答案(071-6)
6.(4-21) choose the best answer: View the Exhibit and examine the structure of the CUSTOMERS table. ...
- OCP 12c最新考试原题及答案(071-5)
5.(4-12) choose two: You executed the following CREATE TABLE statement that resulted in an error: SQ ...
- OCP 12c最新考试原题及答案(071-4)
4.(4-11) choose two:View the Exhibit and examine the data in the PRODUCT_INFORMATION table.Which two ...
- OCP 12c最新考试原题及答案(071-3)
3.(4-10) choose the best answer:The user SCOTT who is the owner of ORDERS and ORDER_ITEMS tables iss ...
随机推荐
- linux系统软件版本升级
在安装完软件之后,在同一层目录生成一个符号链接,并把当前软件的目录映射到这个链接上,后面的操作都只通过这个链接去做,以后升级版本的时候,把最新的软件目录映射到这个链接上就可以了. 如我刚装的apach ...
- SQL 数据库 学习 005 学习必备的一些操作 --- 如何新建数据库 如何附加和分离数据库(如何备份还原数据库) 如何删除数据库
我的电脑系统: Windows 10 64位 使用的SQL Server软件: SQL Server 2014 Express 如果我们要学习这个数据库,我们需要学习什么知识.比如:如何新建一个数据库 ...
- CF 1097D Makoto and a Blackboard
算是记一下昨天晚上都想了些什么 官方题解 点我 简单题意 给定两个正整数$n$和$k$,定义一步操作为把当前的数字$n$等概率地变成$n$的任何一个约数,求$k$步操作后的期望数字,模$1e9 + ...
- Spring思维导图(AOP篇)
什么是aop AOP(Aspect-OrientedProgramming,面向方面编程),可以说是OOP(Object-Oriented Programing,面向对象编程)的补充和完善.OOP允许 ...
- [C#] IEnumerable vs IQueryable
这篇博客将介绍IEnumerable和IQueryable之间的区别. 1. IQueryable是继承自IEnumerable接口的.所以IEnumerable能做的,IQueryable都能做. ...
- Perl 学习笔记-正则表达式基础篇
1.Perl中的正则表达式 在Perl中叫做模式, 是一个匹配(或不匹配)某字符串的模板, 是一种小程序, 对于一个字符串, 要么匹配, 要么不匹配. 使用简易模式: 将模式写在一对正斜线(/)中即可 ...
- 【转载】Maven+druid+MyBatis+Spring+Oracle+Dubbo开发环境搭建
原地址:http://blog.csdn.net/wp1603710463/article/details/48247817#t16 Maven+druid+MyBatis+spring+Oracle ...
- Reactor模式和NIO(转载二)
本文可看成是对Doug Lea Scalable IO in Java一文的翻译. 当前分布式计算 Web Services盛行天下,这些网络服务的底层都离不开对socket的操作.他们都有一个共同的 ...
- CodeForces 814D An overnight dance in discotheque(贪心+dfs)
The crowdedness of the discotheque would never stop our friends from having fun, but a bit more spac ...
- centos 7 安装jdk8
到官网下载jdk http://www.oracle.com/technetwork/java/javase/downloads/index.html 选择liunx的tar.gz文件下载 下载好后 ...