Database Fundamentals — Question 38

You need to combine the results of two queries into a single result that contains all of the rows from both queries.
Which Structured Query Language (SQL) statement should you use?

Answer options

Correct answer: D

Explanation

The correct answer is D, UNION, because it combines the results of two queries and includes all rows from both, removing duplicates. TRUNCATE (A) is used to delete all rows in a table, JOIN (B) combines rows from two or more tables based on a related column, and EXCEPT (C) returns rows from the first query that are not present in the second, which is not what is required here.