Oracle Database Administration I — Question 112
Which is the default column or columns for sorting output from compound queries using SET operators such as INTERSECT in a SQL statement?
Answer options
- A. the first NUMBER column in the first SELECT of the compound query
- B. the first NUMBER or VARCHAR2 column in the last SELECT of the compound query
- C. the first column in the last SELECT of the compound query
- D. the first column in the first SELECT of the compound query
- E. the first VARCHAR2 column in the first SELECT of the compound query
Correct answer: D
Explanation
The correct answer is D because SQL uses the first column from the first SELECT statement of the compound query for sorting by default. The other options refer to columns in the last SELECT or specific data types, which do not apply to the default sorting behavior in compound queries.