A report requires data from two tables: Customers and Orders. Which SQL clause is used to combine rows from both tables based on a related column?
Trap 1: UNION
UNION combines result sets vertically, not based on relationships.
Trap 2: SUBQUERY
A subquery is nested inside another query; it does not combine tables in the same way.
Trap 3: INTERSECT
INTERSECT returns common rows from two queries, not a join.
- A
UNION
Why wrong: UNION combines result sets vertically, not based on relationships.
- B
SUBQUERY
Why wrong: A subquery is nested inside another query; it does not combine tables in the same way.
- C
JOIN
JOIN merges rows from tables based on a condition, typically a foreign key.
- D
INTERSECT
Why wrong: INTERSECT returns common rows from two queries, not a join.