nerdexam
Oracle

1Z0-061 · Question #180

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…

Using the SET Operators

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

(54 responses)
  • A
    78% (42)
  • B
    7% (4)
  • D
    15% (8)

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

#ORDER BY#UNION#column aliases#SET operator ordering

Community Discussion

No community discussion yet for this question.

Full 1Z0-061 Practice