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. vs启动项目提示Web 服务器被配置为不列出此目录的内容。

    解决方法 确认网站或应用程序配置文件中的 configuration/system.webServer/directoryBrowse@enabled 属性已设置为 true. 配置一下web.con ...

  2. java 序列化时排除指定属性

    java 序列化对象如何排除指定属性呢? java 中序列化对象有多种方式:struts2 ,jackson,json-lib (1)使用struts2 json插件 依赖的jar包:struts2- ...

  3. onItemLongClick+onCreateContextMenu实现长按ListItem弹出不同菜单

    个ListActivity,长按不同的item弹出的菜单不一样 参照

  4. Oracle ADF 创建序列

    双击VO,打开Attribute 标签页在弹出的窗口中选择Default Value Type 为“Expression”, value 的值为:(new oracle.jbo.server.Sequ ...

  5. 转载:字符串hash总结(hash是一门优雅的暴力!)

    转载自:远航休息栈 字符串Hash总结 Hash是什么意思呢?某度翻译告诉我们: hash 英[hæʃ] 美[hæʃ]n. 剁碎的食物; #号; 蔬菜肉丁;vt. 把…弄乱; 切碎; 反复推敲; 搞糟 ...

  6. stl源码分析de练习

    // StlTest1.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <vector> #include & ...

  7. centos firewall-cmd常用命令

    firewall-cmd --list-all firewall-cmd --zone=public --add-port=12345/tcp --permanent firewall-cmd --z ...

  8. MyEclipse中Web项目文件名上红色和黄色感叹号处理

      MyEclipse中Web项目文件名上红色和黄色感叹号处理     先说红色感叹号: 那就是代表错误,说明你引用的JAR包位置无效,所以,你应该重新将包导入到工程里面去,这个具体应该会吧,如果是初 ...

  9. [operator]ubuntu + sublime + anaconda 自动补全、指定python版本

    ubuntu .sublime.anaconda都安装好之后,首先要解决的就是自动补全问题 Perference---->Browes Packages --->新建一个Python的文件 ...

  10. UVa 1606 Amphiphilic Carbon Molecules (扫描法+极角排序)

    题意:平面上有 n 个点,每个点不是黑的就是白的,现在要放一个隔板,把它们分成两部分,使得一侧的白点数加上另一侧的黑点数最多. 析:这个题很容易想到的就是暴力,不妨假设隔板至少经过两个点,即使不经过也 ...