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. windows删除服务的命令行语句

    想要删除windows xp里的一个服务,怎么办呢? 系统没有可视化的工具可以用,不过内置了一个cmd命令 sc.exe 具体操作方法是:开始--运行--cmd,进入cmd命令行. 然后输入: sc ...

  2. shell中的字符串操作和数学运算

    字符串操作   变量赋值: 说明:变量值可以用单引号.双引号.或者不加任何引号来赋值给变量 变量名="变量值" 变量名='变量值' 变量名=变量值 例如:str="hel ...

  3. 13.Roman to Integer (HashTable)

    Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 t ...

  4. Windows10远程桌面连接配置

    被控电脑在TP-Link路由器 1.基本设置 被控端电脑设置:1)被控端的电脑系统需要是Windows专业版或者企业版,家庭中文版的系统是不支持远程访问功能的: 2)被控端打开远程桌面功能,在系统的设 ...

  5. python 开发简单的聊天工具-乾颐堂

    python 太强大了,以至于它什么都可以做,哈哈,开个玩笑.但是今天要讲的真的是一个非常神奇的应用. 使用python写一个聊天工具 其实大家平时用的QQ类似的聊天工具,也是使用socket进行聊天 ...

  6. Java设计模式(6)——建造者模式

    定义:Builder模式也叫建造者模式或者生成器模式,Builder模式是一种对象创建型模式之一,用来隐藏复合对象(对象的属性为另一个对象的引用)的创建过程,它把复合对象的创建过程交给Builder, ...

  7. 关于C语言中的Complex(复数类型)和imaginary(虚数类型)

    关于C语言中的Complex(复数类型)和imaginary(虚数类型) 其实这里的复数complex就是数学里的复数,包含实部和虚部两个部分,比如:x=2.1+6i,下面进行详细介绍. C99 新增 ...

  8. CentOS 7如何开放其它的端口,比如8080

    CentOS 7如何开放其它的端口,比如8080 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop ...

  9. 数据结构(c语言版)文摘

    第一章  绪论 数据结构:是一门研究非数值计算的程序设计问题中计算机的操作对象以及它们之间的关系和操作等的学科. 数据:是对客观事物的符号表示,在计算机科学中是指所有能输入到计算机中并被计算机程序处理 ...

  10. cannot be cast to

    java.lang.ClassCastException: com.service.impl.OrderPlanServiceImpl cannot be cast to com.provider.s ...