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. 【 Makefile 编程基础之…

    本站文章均为李华明Himi原创,转载务必在明显处注明: 转载自[黑米GameDev街区] 原文链接: http://www.himigame.com/gcc-makefile/766.html 概述: ...

  2. 从零玩转JavaWeb系列7web服务器-----get与post的区别

    总结get与post的区别 get参数通过url传递,post放在request body中. get请求在url中传递的参数是有长度限制的,而post没有. get比post更不安全,因为参数直接暴 ...

  3. jenkins-为什么要持续集成

    持续集成(Continuous Integration),也就是我们经常说的 CI,是现代软件开发技术的基础.本文论述了当前软件开发过程中存在的问题,讲解了持续集成.持续集成服务器的概念,最终探讨了为 ...

  4. 3D数学基础 KeyNote 1

    [计算几何复习要点] 1.向量加法的几何含意: a+b的释意为:a的尾连上b的头,新建一条从a的尾指向b的头的向量. 2.向量减法的几何含意: a-b的释意为:尾部相连,新建一个从b的头指向a的头的向 ...

  5. cdoj914-方老师分身 I 【dijkstra】

    http://acm.uestc.edu.cn/#/problem/show/914 方老师分身 I Time Limit: 3000/1000MS (Java/Others)     Memory ...

  6. ubuntu18 tensorflow faster_rcnn cpu训练自己数据集

    (flappbird) luo@luo-ThinkPad-W540:tf-faster-rcnn$ ./experiments/scripts/train_faster_rcnn.sh 0 pasca ...

  7. SpringBoot与Shiro的整合(单体式项目)

    1.包结构 2.jar包,配置文件,类 2.1pom.xml文件配置 <?xml version="1.0" encoding="UTF-8"?> ...

  8. Linux下Maven的安装与使用

    pache Maven,是一个软件(特别是Java软件)项目管理及自动构建工具,由Apache软件基金会所提供.基于项目对象模型(POM)概念,Maven利 用一个中央信息片断能管理一个项目的构建.报 ...

  9. linux常用的一些命令行操作(ubuntu)

    软件安装 sudo apt-get install xxx 压缩和解压缩 1. *.tar 用 tar –xvf 解压 2. *.gz 用 gzip -d或者gunzip 解压 3. *.tar.gz ...

  10. 出现命令提示apt-get -f install的解决方法

    提示apt-get -f install这个信息,然后查看其他的提示信息发现时缺少了一些以依赖库. 解决办法为执行:sudo apt-get -f install命令. 该命令的含义是去补全那些缺少的 ...