Consider the below given query SELECT column_name(s) FROM table1 command…
2025
Consider the below given query
SELECT column_name(s) FROM table1
command
SELECT column_name(s) FROM table2;
What should the database manager write in place of command to get distinct values from table1 and table2 of column_name(s)?
- A.
SET DIFFERENCE
- B.
DISTINCT
- C.
UNION
- D.
UNION ALL
Attempted by 858 students.
Show answer & explanation
Correct answer: C
Ans C
Solution
The UNION operator selects only distinct values by default. To allow duplicate values, use UNION ALL: