【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 ...
随机推荐
- IOS 键盘的显示与关闭
在每一个IOS应用中,几乎不可避免的要进行文本输入操作,例如要求用户填写登陆注册信息,进行话题的评论回复,等等.用到的文本输入组件有UITextField,UITextView,对于这两个组件的相关属 ...
- shell编程——sed用法
一.sed格式: sed 参数 '正则表达式' 文件名 演示文件的内容: [root@localhost ~]# cat test.sh #!/bin/bash 第一行 12345! 第二行 2345 ...
- Spring PropertyPlaceholderConfigurer占位符用法
1.PropertyPlaceholderConfigurer是一个bean工厂后置处理器的实现,也就是BeanFactoryPostProcessor接口的一个实现.PropertyPlacehol ...
- 两个不同vim之间复制内容
常规想法是打开两个vim,然后进行yy和p操作,但是实践证明根本是不行的.此时,我们需要分割窗口,然后就可以复制粘贴了.步骤如下: 假设我要把srv.c文件的readline函数整体复制到cli.c文 ...
- rocketmq刷盘过程
本文基于rocketmq4.0版本,结合CommitlLog的刷盘过程,对消息队列的刷盘过程源码进行分析,进而对RocketMQ的刷盘原理和过程进行了解. rocketmq 4.0版本中刷盘类型 ...
- Gson 是google解析Json的一个开源框架,同类的框架fastJson,JackJson
Gson 是google解析Json的一个开源框架,同类的框架fastJson,JackJson等等 本人fastJson用了两年,也是从去年才开始接触Gson,希望下面的总结会对博友有用,至于Gso ...
- 191. Number of 1 Bits 二进制中1的个数
[抄题]: Write a function that takes an unsigned integer and returns the number of ’1' bits it has (als ...
- Github 使用的Markdown语言
简介 官方站点:http://daringfireball.net/projects/markdown/syntax 中文介绍:http://www.worldhello.net/gotgithub/ ...
- 面向对象的JavaScript-002
1. <script type="text/javascript"> // Define the Person constructor var Person = fun ...
- STL中mem_fun, mem_fun_ref用法
1.引言 先看一个STL中for_each的用法: #include <iostream> #include <vector> #include <algorithm&g ...