All jobs / Data analyst / BI / SQL
Data analyst / BI interview question · 0–1 years
You LEFT JOIN orders, then WHERE orders.status = 'paid'. What did you just do?
The strongest answer
Turned the LEFT into an INNER — unpaid and no-order customers disappear; I filter in the join or keep NULLs on purpose
Why it works
Exactly. A WHERE on the right side drops the unmatched. That is an INNER with extra steps.
What a good answer covers
- WHERE on the right kills the LEFT.
- Filter in the ON or accept the INNER.
- NULLs are the unmatched.
- Say which you meant.
Answers that fall short
- Close, but not the strongest: A more efficient LEFT JOIN
It is not an optimisation story. - Weak: A way to keep everyone and highlight paid
You did not keep everyone. - Red flag: Nothing material
It is the classic silent grain change.
Who gets asked this
More SQL questions
- You need each order and the customer’s lifetime total on the same row. What do you use?
- You join orders to refunds (many refunds per order) then average order value. What bites you?
- A customer dimension has two rows per person after an address change. How do you join a fact?
- A “helpful” dashboard takes a raw table name from a query string. What do you say?
- You want each user’s first paid order date next to every order. How?
- A query that was fine on a sample scans the lake for 20 minutes in prod. What do you look at?
- A popular dashboard scans a year of raw events every open. What do you do?
- A junior’s query is correct and unreadable. How do you review?