Oracle Database SQL — Question 29
Which two are true about a SQL statement using SET operators such as UNION? (Choose two.)
Answer options
- A. The data type group of each column returned by the second query must match the data type group of the corresponding column returned by the first query.
- B. The names and number of columns must be identical for all select statements in the query.
- C. The data type of each column returned by the second query must be implicitly convertible to the data type of the corresponding column returned by the first query.
- D. The data type of each column returned by the second query must exactly match the data type of the corresponding column returned by the first query.
- E. The number, but not names, of columns must be identical for all select statements in the query.
Correct answer: A, E
Explanation
Answer A is correct because when using UNION, the data type groups of corresponding columns must match. Answer E is also correct as the number of columns must be the same, although their names do not have to match. The other options are incorrect because they impose additional requirements on the names or types that are not necessary for a UNION operation.