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.
The number of columns selected in all SELECT statements need to be the same

B.
Names of all columns must be identical across all SELECT statements

C.
By default, the output is not sorted

D.
NULL values are not ignored during duplicate checking

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 6

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


Eamon

Eamon

The only correct answer is D.

A is wrong because this works …
select CONCAT(CUST_FIRST_NAME, CUST_SECON_NAME) from customers — 2 columns selected
UNION
select NAME from cust — 1 column selected

shape

shape

Eamon, you’re wrong.
When you execute this query:
select 1, 2 from dual
union
select 1 from dual;

it results with an error:
ORA-01789: query block has incorrect number of result columns.

Eamon

Eamon

Hello Shape,
Please note I did use a CONCAT function. The code you placed here is doesn’t.
Try this….

SQL> select CONCAT(‘A’, ‘B’) from dual
2 union
3 select ‘AC’ from dual
4 /

CO

AB
AC

By the way I completed this exam. I have some (approx 10) updated questions if you are interested.
mail me on [email protected]

Good luck

Sadiq Al Sahaf (Sojib)

Sadiq Al Sahaf (Sojib)

I think ‘B’ and ‘D’ are Correct Answer.

Jenny

Jenny

A and D are correct