Which two are true about a SQL statement using SET operators such as UNION? (Choose two.)
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.
I would also say A and B - "...Tables must have the same number of columns presented in the same order. In addition, the data type of the corresponding column must be in the same data type group such as number or character..."
In queries using set operators, Oracle does not perform implicit conversion across data type groups. Therefore, if the corresponding expressions of component queries resolve to both character data and numeric data, Oracle returns an error.
https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/The-UNION-ALL-INTERSECT-MINUS-Operators.html#GUID-B64FE747-586E-4513-945F-80CB197125EE
A and B are correct.
For SET operator, Data type group should be matched.
For example, a NUMBER column in first query can be UNIONed with INTERGER column in second query.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
danito
Highly Voted 4 years, 1 month agoelbelgounetos
3 years, 4 months agoEkos
3 years, 7 months agoRivaldo11
Highly Voted 3 years, 12 months agoShinju_dy
Most Recent 3 months, 4 weeks agoHell3n
10 months, 1 week agoit6567306
2 months, 1 week agoOracle2020
10 months, 2 weeks agoOracle2020
3 months, 2 weeks agomamadu
1 year agoauwia
1 year agofthusa
1 year, 1 month agoLeandroHPN
2 years agoryuah
2 years, 6 months agoavanand
3 years, 10 months agoyou1234
4 years ago