QuestionQ85

VerifiedData science concepts

A Data Scientist receives a retail customer-transactions dataset for analysis named table_A. The dataset contains 15 columns and 500 rows, and its customer_id column has a unique value in every row.

The Scientist also receives another dataset named table_B. This dataset contains 15 columns and 2,500 rows, and its customer_id column has a unique value in every row.

There are 200 customer_id values in the table_A dataset that match customer_id values in the table_B dataset.

This query is run:

Question Image

How many rows are returned?

Explanation

A LEFT JOIN returns every row from the left table, including rows with no matching value in the right table. Since customer_id is unique in both tables, each table_a row can produce no more than one joined row. All 500 rows from table_a are therefore returned; 200 have matching table_b data and 300 have NULL values for the table_b columns.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!