Valid 1z0-071 Dumps shared by ExamDiscuss.com for Helping Passing 1z0-071 Exam! ExamDiscuss.com now offer the newest 1z0-071 exam dumps, the ExamDiscuss.com 1z0-071 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com 1z0-071 dumps with Test Engine here:
Examine this SQL statement: SELECT cust_id, cus_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.
Correct Answer: A,E
In SQL, the ORDER BY clause can refer to columns by their alias defined in the SELECT clause or by their positional number in the SELECT list. It's important to understand that after a UNION, the column names in the ORDER BY clause refer to the first SELECT statement's column names and aliases: * Option A: ORDER BY 2, 1This is correct because it refers to the second and first columns in the first SELECT clause, which correspond to the aliases "Last Name" and cust_id, respectively. * Option E: ORDER BY "Last Name"This is correct because "Last Name" is a valid alias defined in the first SELECT clause. The other options fail for the following reasons: * Option B: "CUST_NO" is not recognized in the ORDER BY clause because it's not an alias used in the first SELECT statement. * Option C: Incorrect because 2, cust_id mixes positional reference with a column name that doesn't apply to both SELECT statements consistently. * Option D: ORDER BY CUST_NO fails because CUST_NO is not an alias in the first SELECT clause.