28.choose the best answer

Evaluate the following SQL statement:

SQL> SELECT promo_id, promo_category

FROM promotions

WHERE promo_category = 'Internet' ORDER BY 2 DESC

UNION

SELECT promo_id, promo_category

FROM promotions

WHERE promo_category = 'TV'

UNION

SELECT promo_id, promo_category

FROM promotions

WHERE promo_category ='Radio';

Which statement is true regarding the outcome of the above query?

A) It produces an error because the ORDER BY clause should appear only at the end of a compound query-that is, with the last SELECT statement.

B) It executes successfully and displays rows in the descending order of PROMO_CATEGORY.

C) It produces an error because positional notation cannot be used in the ORDER BY clause with SET operators.

D) It executes successfully but ignores the ORDER BY clause because it is not located at the end of the compound statement.

Answer:A

(执行时 order by 子句只能出现最后的 select 语句,否则出现“ORA-00933: SQL 命令未正确结束”错误)

【OCP认证12c题库】CUUG 071题库考试原题及答案(28)的更多相关文章

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

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

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

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

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

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

  4. 【12c OCP】CUUG OCP认证071考试原题解析(36)

    36.choose the best answer View the Exhibits and examine the structures of the PRODUCTS, SALES, and C ...

  5. 【Oracle 12c】CUUG OCP认证071考试原题解析(35)

    35.choose the best answer View the Exhibit and examine the description of the EMPLOYEES table. Evalu ...

  6. 【12c OCP】CUUG OCP认证071考试原题解析(34)

    34.choose two View the Exhibit and examine the structure of the PRODUCT_INFORMATION and INVENTORIES ...

  7. 【12c OCP】CUUG OCP认证071考试原题解析(33)

    33.choose the best answer View the Exhibit and examine the structure of the ORDER_ITEMS table. Exami ...

  8. 【Oracle 12c】CUUG OCP认证071考试原题解析(32)

    32.choose the best answer View the Exhibit and examine the data in EMP and DEPT tables. In the DEPT ...

  9. 【Oracle 12c】CUUG OCP认证071考试原题解析(31)

    31.choose the best answer Which statement is true regarding the USING clause in table joins? A) It c ...

随机推荐

  1. JVM知识点精华汇总

    本文是学习了<深入理解Java虚拟机>之后的总结,主要内容都来自于书中,也有作者的一些理解.一是为了梳理知识点,归纳总结,二是为了分享交流,如有错误之处还望指出.(本文以jdk1.7的规范 ...

  2. Redis Key操作

    [Redis Key操作] 1.GETSET key value 将给定 key 的值设为 value ,并返回 key 的旧值(old value). 当 key 存在但不是字符串类型时,返回一个错 ...

  3. Linux进程之Fork函数

    Fork()函数 1.所需头文件: #include <unistd.h> #include<sys/types.h> 2.函数定义 pid_t fork( void ); p ...

  4. Django基础学习五_引入静态文件

    今天继续学习Django,今天主要掌握两个小点 一.如果为Django项目中引入静态文件 1.先要在project目录下创建static的目录,然后将jquery文件拷贝这个目录下就可以了 2.在pr ...

  5. 6-关于#include<bits/stdc++.h>

    万能头文件#include<bits/stdc++.h> (转载)   最近在打cf时赛后翻阅别人的代码总是会发现一个陌生而奇怪的头文件#include<bits/stdc++.h& ...

  6. golang语言基础(一)

    0.项目的组织结构: GOPATH路径下是src文件夹---->src文件夹下是项目名称---->项目名称下是该项目的各个包名---->各包名下是.go文件(一个包下,无论有多少个. ...

  7. Makefiles in Linux

    http://www.codeproject.com/Articles/31488/Makefiles-in-Linux-An-Overview

  8. Ansible常用模块命令

    Ansible常用模块命令 一.安装ansible yum install epel-release yum install ansible 二.配置文件配置 vi /etc/ansible/ansi ...

  9. Quartz2D Text

    [Quartz2D Text] Quartz 2D provides a limited, low-level interface for drawing text encoded in the Ma ...

  10. thinkphp整合系列之phpexcel导入excel数据

    一:导入phpexcel /ThinkPHP/Library/Vendor/PHPExcel 二:导入excel的函数 /** * 导入excel文件 * @param string $file ex ...