23.choose the best answer

View the Exhibits and examine PRODUCTS and SALES tables.

You issue the following query to display product name and the number of times the

product has been sold:

SQL>SELECT p.prod_name, i.item_cnt

FROM (SELECT prod id, COUNT(*) item_cnt

FROM sales GROUP BY prod_id) i RIGHT OUTER JOIN products p

ON i.prod_id = p.prod_id;

What happens when the above statement is executed?

A) The statement executes successfully and produces the required output.

B) The statement produces an error because a subquery in the FROM clause and outer-joins cannot be used together.

C) The statement produces an error because ITEM_CNT cannot be displayed in the outer query.

D) The statement produces an error because the GROUP BY clause cannot be used in a subquery in the FROM clause.

Answer:A

(SQL> select d.dname,e.emp_cnt

from (select deptno,count(*) emp_cnt from emp group by deptno)e right outer join dept d

on e.deptno=d.deptno;

DNAME EMP_CNT

-------------- ----------

ACCOUNTING 2

RESEARCH 4

SALES 6

OPERATIONS

TRAIN)

【OCP-12c】CUUG 071题库考试原题及答案解析(23)的更多相关文章

  1. 【OCP认证12c题库】CUUG 071题库考试原题及答案(28)

    28.choose the best answer Evaluate the following SQL statement: SQL> SELECT promo_id, promo_categ ...

  2. 【OCP认证12c题库】CUUG 071题库考试原题及答案(27)

    27.choose two The SQL statements executed in a user session are as follows: SQL> CREATE TABLE pro ...

  3. 【OCP认证12c题库】CUUG 071题库考试原题及答案(26)

    26.choose two Examine the structure of the PRODUCTS table. Which two statements are true? A) EXPIRY_ ...

  4. 【OCP认证12c题库】CUUG 071题库考试原题及答案(25)

    25. choose the best answer Evaluate the following SQL statement: ALTER TABLE hr.emp SET UNUSED (mgr_ ...

  5. 【OCP-12c】CUUG 071题库考试原题及答案解析(24)

    24. choose the best answer In the EMPLOYEES table there are 1000 rows and employees are working in t ...

  6. 【OCP-12c】CUUG 071题库考试原题及答案解析(22)

    5.choose the best answer Evaluate the following CREATE SEQUENCE statement: CREATE SEQUENCE seq1 STAR ...

  7. 【OCP-12c】CUUG 071题库考试原题及答案解析(21)

    3.choose three View the Exhibit and examine the description of SALES and PROMOTIONS tables. You want ...

  8. 【OCP-12c】CUUG 071题库考试原题及答案解析(20)

    20.choose two Examine the description of the EMP_DETAILS table given below: Which two statements are ...

  9. 【OCP-12c】CUUG 071题库考试原题及答案解析(19)

    1.choose the best answerWhat is the primary difference between the relational database (RDB) andobje ...

随机推荐

  1. 实用 Linux 命令行使用技巧集锦

    最近在Quora上看到一个问答题目,关于在高效率Linux用户节省时间Tips.将该题目的回答进行学习总结,加上自己的一些经验,记录如下,方便自己和大家参考. 下面介绍的都是一些命令行工具,这些工具在 ...

  2. 【python 】装饰器 (多个参数的函数,带参数的装饰器)【转】

    最简单的模板是这样的 #-*-coding:utf-8-*- def outer(func): def inner(): print 'before' func() print 'after' # r ...

  3. 7.25 6figting!

    TEXT 82 Proton 马来西亚宝腾汽车 A fork in the road 何去何从?(陈继龙编译) Nov 30th 2006 | HONG KONG From The Economist ...

  4. Gerrit 系统初探 (已转移到 https://steemit.com/gerrit/@linvictor88/gerrit )

    Gerrit 使用简介        Gerrit,一种免费.开放源代码的代码审查软件,使用网页界面.利用网页浏览器,同一个团队的软件程序员,可以相互审阅彼此修改后的程序代码,决定是否能够提交,退回或 ...

  5. Spring Cloud Config配置中心的使用

    一.概述 1. 为什么使用? 1> 配置文件太多,不方便维护 2> 配置文件一般都保存这各种明文显示的密码,无法保证配置内容的安全性,也无法做到按权限分配给个人 3> 更新配置项目需 ...

  6. Liunx 解压篇

    解压完 却不知道到哪里去了这时

  7. nSum “已知target再求和”类型题目总结:n-2重循环+left/right

    Sum类的题目一般这样: input: nums[], target output: satisfied arrays/ lists/ number 拿到题目,首先分析: 1. 是几个数的sum 2. ...

  8. jquery text() html() val()

    test text() 返回 test html() 返回 test val() 没值, val() 适用于有value属性的元素, 例如: input

  9. Linux automake命令

    1)automake 使用教程 http://loftor.com/archives/automake.html 2)configure.in Makefile.am解析 http://blog.cs ...

  10. TabHost tab项单击事件

    TabHost 选项发生变化时会触发OnTabChangedListener事件,但是如果当前已经选中第一项,再次单击该项时,OnTabChangedListener不会触发该事件,所以再次单击选中t ...