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)的更多相关文章

  1. 【OCP-12c】CUUG最新考试原题整理及答案(071-11)

    11.(5-8) choose the best answer: Examine the structure of the BOOKS_TRANSACTIONS table. You want to ...

  2. 【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 ...

  3. 【OCP-12c】CUUG最新考试原题整理及答案(071-9)

    9.(5-5) choose the best answerView the Exhibit and examine the structure of the SALES and STORES tab ...

  4. 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 ...

  5. OCP 12c最新考试原题及答案(071-7)

    7.(5-1) choose two:View the Exhibit and examine the structure of the PRODUCTS table.Which two tasks ...

  6. OCP 12c最新考试原题及答案(071-6)

    6.(4-21) choose the best answer: View the Exhibit and examine the structure of the CUSTOMERS table. ...

  7. OCP 12c最新考试原题及答案(071-5)

    5.(4-12) choose two: You executed the following CREATE TABLE statement that resulted in an error: SQ ...

  8. OCP 12c最新考试原题及答案(071-4)

    4.(4-11) choose two:View the Exhibit and examine the data in the PRODUCT_INFORMATION table.Which two ...

  9. 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 ...

随机推荐

  1. cmder 设置

    添加到系统变量 windows10可直接使用小娜搜索环境变量,然后将Cmder.exe所在目录加入Path项即可.之后通过win+r输入cmder即可启动 添加到右键菜单 在管理员权限的命令窗口下(可 ...

  2. pid文件的作用

    pid文件的作用 一.pid文件的作用 1.pid文件的内容用cat命令查看,可以看到内容只有一行,记录了该进程的ID 2.pid文件的作用防止启动多个进程副本 3.pid文件的原理进程运行后会给.p ...

  3. 【ZOJ 3228】Searching the String 【AC自动机】

    题意 给出n个模式串和一个文本串,输出各个模式串在文本串中出现的次数.模式串有两种类型,0类型代表可以有重叠,1类型代表不能有重叠.模式串可能出现重复. 分析 算是AC自动机的模板题? 因为模式串可以 ...

  4. 【HDU1542】Atlantis

    题意 给出n个矩形的左下角和右上角的坐标,计算总的面积(相交部分只算一次). 分析 线段树扫描线的模板题. 将每个矩形都拆成上下两条线段,然后从下网上扫,当遇到底边时就加上这个区间,遇到顶边时,就减去 ...

  5. 150. Evaluate Reverse Polish Notation (Stack)

    Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, ...

  6. Library not found for -lAPOpenSdk

    多人开发合作的时候 总是会遇见各种各样的问题 今天就来讲一个关于友盟的问题 在我的小伙伴 用cocoapods 中添加了这样一句话 pod ‘UMengSocialCOM’,  并且pod updat ...

  7. 78. Subsets 求所有子集(有重复就continue)

    [抄题]: Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The ...

  8. 637. Average of Levels in Binary Tree 二叉树的层次遍历再求均值

    [抄题]: Given a non-empty binary tree, return the average value of the nodes on each level in the form ...

  9. HBase、HDFS与本地文件系统之间的关系

    一.文件系统 1. 概念 所谓文件系统,是操作系统用于明确磁盘或分区上的文件的方法和数据结构:即在磁盘上组织文件的方法.也指用于存储文件的磁盘或分区,或文件系统种类. 2. Local File Sy ...

  10. Source Insight: has been changed outside of Source Insight

    has been changed outside of Source Insight 2018年04月26日 09:41:01 linux_c_coding_man 阅读数:247 摘自:https: ...