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. ROS解决网页断流现象 (转)

    “pppoe-client”接口,将“MAX MTU”和“MAX MRU”都设置成“” /ip firewall mangle add action=change-mss chain=forward ...

  2. Junit Test 的时候出错java.lang.IllegalStateException: Failed to load ApplicationContext

    问题原因 JDK1.8    spring版本3.2.0RELEASE JDK和spring版本不兼容 解决方法 1.降低JDK版本到1.7 2.将spring的版本升级到4.0.0RELEASE或者 ...

  3. 【原】Coursera—Andrew Ng机器学习—课程笔记 Lecture 16—Recommender Systems 推荐系统

    Lecture 16 Recommender Systems 推荐系统 16.1 问题形式化 Problem Formulation 在机器学习领域,对于一些问题存在一些算法, 能试图自动地替你学习到 ...

  4. jQuery插件–jqueryflexselect下拉框自动提示

    原理:用户在文本框中输入一个字符(或输入字符的首字母),然后利用ajax,从后台服务器中进行检索,组装后并返回到页面,页面通过javascript进行解析,在一个层里面显示出来. 类似的效果如下: & ...

  5. 为什么要用Android Studio?

    为什么要用Android Studio 本书节选自<Android Studio实用指南> 作者: 毕小朋 目前本书已上传到百度阅读,在百度中搜索[Anroid Studio实用指南]便可 ...

  6. Linux显示文件前几行、拷贝文件前几行、删除文件前几列

    [一]显示文件前几行 ll -lrth:按照更改时间倒序排列,最新文件在下边 ll -lrSh:按照文件大小倒序排列,最大文件在下边 grep --color :高亮查询关键字 grep -A 10 ...

  7. CloudStack 安装时需要的第三方包

    1.mysql-connector-java 2.jakarta-commons-daemon-jsvc 3.jsvc   rpm -ivh cloudstack-common-4.1.1-0.el6 ...

  8. ssdb的高可用,源码分析

    ssdb,一个高性能的支持丰富数据结构的 NoSQL 数据库, 用于替代 Redis.——这是其官网的自我介绍. ssdb在leveldb存储库的基础上进行改造和丰富,添加了类似redis操作的接口, ...

  9. ubuntu下搭建android开发环境

    注意: google可能被和谐了,那就修改hosts sudo vim /etc/hosts 增加: #Google主页 203.208.46.146 www.google.com #这行是为了方便打 ...

  10. jvisualvm远程监控服务器tomcat

    1.在 {服务器tomcat路径}/bin/catalina.sh 中,的[# OS specific support.  $var _must_ be set to either true or f ...