Oracle Database Administration I — Question 76
Examine this SQL statement:
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 -
Identify three ORDER BY clauses, any one of which can complete the query successfully. (Choose three.)
Answer options
- A. ORDER BY ג€Last Nameג€
- B. ORDER BY 2, 1
- C. ORDER BY 2, cust_id
- D. ORDER BY CUST_NO
- E. ORDER BY ג€CUST_NOג€
Correct answer: A, B, C
Explanation
The correct answers are A, B, and C because they align with the columns selected in the UNION query. A references the alias 'Last Name', while B uses column position for ordering, and C references the second column and uses 'cust_id'. Options D and E are incorrect as they refer to an alias that does not exist in the output of the UNION.