Oracle Database Administration I — Question 5
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 of the corresponding column returned by the first query.
- B. The number, but not names, 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 exactly match the data type of the corresponding column returned by the first query.
- D. The names and number of columns must be identical for all SELECT statements in the query.
- E. 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.
Correct answer: A, B
Explanation
Option A is correct because when using UNION, each column's data type group must match between the two queries. Option B is also correct as it specifies that only the number of columns needs to be identical, not their names. Options C, D, and E are incorrect because they impose stricter requirements that are not necessary for executing a UNION operation.