nerdexam
Oracle

1Z0-071 · Question #19

Evaluate the following SQL statement: SQL> SELECT cust_id, cust_last_name "Last Name" FROM customers WHERE country_id = 10 UNION SELECT cust_id CUST_NO, cust_last_name FROM customers WHERE…

The correct answer is A. ORDER BY 2,1 C. ORDER BY 2, cust_id E. ORDER BY "Last Name". Using the ORDER BY Clause in Set Operations - The ORDER BY clause can appear only once at the end of the compound query. - Component queries cannot have individual ORDER BY clauses. - The ORDER BY clause recognizes only the columns of the first SELECT query. - By default, the…

Exadata Administration

Question

Evaluate the following SQL statement:

SQL> SELECT cust_id, cust_last_name "Last Name" FROM customers WHERE country_id = 10 UNION SELECT cust_id CUST_NO, cust_last_name FROM customers WHERE country_id = 30; Which ORDER BY clause are valid for the above query? (Choose all that apply.)

Options

  • AORDER BY 2,1
  • BORDER BY CUST_NO
  • CORDER BY 2, cust_id
  • DORDER BY "CUST_NO"
  • EORDER BY "Last Name"

How the community answered

(45 responses)
  • A
    76% (34)
  • B
    16% (7)
  • D
    9% (4)

Explanation

Using the ORDER BY Clause in Set Operations - The ORDER BY clause can appear only once at the end of the compound query. - Component queries cannot have individual ORDER BY clauses. - The ORDER BY clause recognizes only the columns of the first SELECT query. - By default, the first column of the first SELECT query is used to sort the output in an ascending

Topics

#UNION queries#ORDER BY clause#column aliases#set operators

Community Discussion

No community discussion yet for this question.

Full 1Z0-071 Practice