1Z0-071 practice question 9 of 35
Which statement will execute successfully?
Full set: 326 questionsWhen using set operators like UNION, the ORDER BY clause can only appear once at the end of the entire statement. It can reference columns by their position in the SELECT list. Statement A has two columns in its SELECT list and correctly uses ORDER BY 1, 2 to sort by the first and then the second column. This is valid syntax and will execute successfully. The other options refer to column positions that do not exist in their respective SELECT lists, which will cause an ORA-01785 error.
B. The SELECT list has only one column, but the ORDER BY clause refers to position 3, which does not exist.
C. The SELECT list has two columns, but the ORDER BY clause refers to positions 3 and 4, which do not exist.
D. The SELECT list has one column, but the ORDER BY clause refers to position 2, which does not exist.
Oracle Database SQL Language Reference, 19c, "Set Operators". This section states: "The orderbyclause can appear only once at the end of the compound query."
Oracle Database SQL Language Reference, 19c, "ORDER BY Clause". The documentation specifies: "If you specify position, then it must be an integer from 1 to the number of expressions in the select list." This rule is violated by options B, C, and D.
Keep practicing
Take the free 1Z0-071 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 1Z0-071 practice questions
- Question 2Which three statements are true about single row functions?
- Question 3Which statement executes successfully?
- Question 4Which two are true about transactions in the Oracle Database?
- Question 6Which two are true about external tables that use the ORACLE _DATAPUMP access driver?
- Question 10Examine this statement: CREATE TABTE orders (sarial_no NUMBER UNIQUE, order_id NUMBER PRI…
- Question 11You have the privileges to create any type of synonym. Which stalement will create a syno…
