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

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 命令未正确结束”错误)

原文地址:http://blog.51cto.com/13854012/2352847

时间: 2024-11-05 23:31:23

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

【第31题】2019年OCP-12C-062最新考试原题-31

31.choose one You want to create a test database as a replica of your production database with minimum intervention from a DBA. Which method would you use? A) Use DBCA to create a template from the existing database to contain the database structure

【第30题】2019年OCP-12C-062最新考试原题-30

30.choose one Identify the access that is initially available to connect to your Database as a Service (DBaaS) environment. A) SSL/TLS on port 443 B) SSH on port 22 C) Cloud Control on port 7799 D) telnet on port 23 E) Enterprise Manager on port 1158

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

choose the best answer Evaluate the following SQL statement: ALTER TABLE hr.emp SET UNUSED (mgr_id); Which statement is true regarding the effect of the above SQL statement? A) Any views created on the EMP table that include the MGR_ID column would b

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

26.choose two Examine the structure of the PRODUCTS table. Which two statements are true? A) EXPIRY_DATE always stores date and time in character format B) PRICE can store a maximum of eight digits and two decimals. C) PRODUCT_PIC can store only vide

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

27.choose two The SQL statements executed in a user session are as follows: SQL> CREATE TABLE product (pcode NUMBER(2), pname VARCHAR2(10)); SQL> INSERT INTO product VALUES (1, 'pen'); SQL> INSERT INTO product VALUES (2,'pencil'); SQL> SAVEPOI

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

30.choose the best answer Examine the commands used to create DEPARTMENT_DETAILS and COURSE_DETAILS: SQL> CREATE TABLE DEPARTMENT_DETAILS (DEPARTMENT_ID NUMBER PRIMARY KEY, DEPARTMENT_NAME VARCHAR2(50) , HOD VARCHAR2(50)); SQL> CREATE TABLE COURSE_D

【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 table, DEPTNO is the PRIMARY KEY. In the EMP table, EMPNO is the PRIMARY KEY and DEPTNO is the FOREIGN KEY referencing the DEPTNO column in the DEPT t

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

34.choose two View the Exhibit and examine the structure of the PRODUCT_INFORMATION and INVENTORIES tables. You have a requirement from the supplies department to give a list containing PRODUCT_ID, SUPPLIER_ID, and QUANTITY_ON_HAND for all the produc

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

33.choose the best answer View the Exhibit and examine the structure of the ORDER_ITEMS table. Examine the following SQL statement: SELECT order_id, product_id, unit_price FROM order_items WHERE unit_price = (SELECT MAX(unit_price) FROM order items G