Which statement is true regarding the UNION operator?

Which statement is true regarding the UNION operator?

Which statement is true regarding the UNION operator?

A.
By default, the output is not sorted.

B.
Null values are not ignored during duplicate checking.

C.
Names of all columns must be identical across all select statements.

D.
The number of columns selected in all select statements need not be the same.

Explanation:

The SQL UNION query allows you to combine the result sets of two or more SQL SELECT
statements. It removes duplicate rows between the various SELECT statements.
Each SQL SELECT statement within the UNION query must have the same number of fields in the
result sets with similar data types.



Leave a Reply 10

Your email address will not be published. Required fields are marked *


Marcelo

Marcelo

This answer is wrong.
The correct is B ( Nulls values are not ignored during duplicate checking)
ALL SQL statement in a query must have same number of columns.
The Explanation put for the answer says that the UNION query must have same number of columns.
A query with a different number of columns returns this error:
ORA-01789:query block has incorrect number of result columns

Mac/Philippines

Mac/Philippines

The correct answer is B. Union operator does not ignore null values.

Sadiq Al Sahaf (Sojib)

Sadiq Al Sahaf (Sojib)

B is the only one Correct Answer.

Humberto

Humberto

La respuesta correcta es la “B”

Fredy

Fredy

D is also correct check this out:

select employee_id from employees
union
select employee_id, salary from employees;

this query shows an error: ORA-01789: query block has incorrect number of result columns

but this

select employee_id, salary from employees
union
select employee_id, salary from employees;

works

Greetings email:[email protected]

Fredy

Fredy

Sorry I didnĀ“t see the NOT word

Google

Google

Sites of interest we have a link to.

Google

Google

We came across a cool internet site that you simply may possibly delight in. Take a appear for those who want.

Ender

Ender

B and D is correct answer.
In D option there is “NOT”. Because of it it is true.
D.
The number of columns selected in all select statements need NOT be the same.
Look at http://www.aiotestking.com/oracle/which-statement-is-true-regarding-the-union-operator-7/
there is no not over there on D option. So That is wrong.