Examine this statement:
Identify three ORDER BY clauses, any one of which will complete the query successfully. (Choose three.)
Examine this statement:
Identify three ORDER BY clauses, any one of which will complete the query successfully. (Choose three.)
To successfully complete the query, the ORDER BY clause must refer to columns available in the result set of the UNION. The UNION operation removes duplicate rows and the resulting columns can only be ordered based on their position or the column names/aliases provided in the first SELECT query. Thus, ORDER BY CUST_NO (as it matches the alias used in the first query) and ORDER BY 2, cust_id or ORDER BY 2, 1 (where 2 refers to the second column in the final result set and 1 refers to the first column) are correct ways to complete the query. ORDER BY "Last Name" or ORDER BY "CUST_NO" would not be valid since those column names or aliases are not recognized in the final UNION result.
You can only order by column names from the first select query
Correct answer is BCD. The ORDER BY clause does not recognize the column names of the second SELECT query. So,