Oracle Database SQL Language Reference 19c states: " The corresponding expressions in the select lists of the component queries of a compound query must match in number and must be in the same data type group (such as numeric or character). " It describes INTERSECT as the operator " which returns only those unique rows returned by both queries. "
D is correct because INTERSECT returns the distinct rows that are present in the results of both component queries. A is correct because set operators match columns by position, not by name; the column names may differ, and the result headings are taken from the first SELECT.
B is incorrect because each SELECT must return the same number of columns with compatible data type groups. C is incorrect because INTERSECT is commutative with respect to the rows returned: A INTERSECT B yields the same set of rows as B INTERSECT A. E is incorrect because set operators treat nulls in corresponding columns as equal, so rows containing NULL can be part of the intersection.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit