Question
A data analyst needs to use one table's data to refine data selection from a second table. Which of the following is the most efficient way?
- A. Subquery Correct
- B. Aggregate
- C. Union
- D. Join
Explanation
A subquery uses the result of a query on one table as a filter for the selection from another table (for example WHERE id IN (SELECT ...)), which is exactly refining the selection with another table's data. A join combines columns from both tables into the result rather than only filtering, a union stacks rows from both tables, and an aggregate summarizes values.