Oracle Database SQL — Question 12
Which two are true about queries using set operators such as UNION? (Choose two.)
Answer options
- A. In a query containing multiple set operators, INTERSECT always takes precedence over UNION and UNION ALL.
- B. An expression in the first SELECT list must have a column alias for the expression.
- C. All set operators are valid on columns of all data types.
- D. CHAR columns of different lengths used with a set operator return a VARCHAR2 whose length equals the longest char value.
- E. Queries using set operators do not perform implicit conversion across data type groups (e.g. character, numeric).
Correct answer: D, E
Explanation
Option D is correct because when CHAR columns of different lengths are combined, the result is a VARCHAR2 that reflects the longest CHAR value. Option E is also accurate, as set operators do not automatically convert data types across different groups, preventing potential data mismatches. The other options either misstate how set operators function or provide incorrect requirements.