All jobs / Data analyst / BI / SQL
Data analyst / BI interview question · 0–1 years
A join fans one customer into five rows. What does COUNT(*) now mean?
The strongest answer
Rows after the fan-out, not customers — if you want people, you need a distinct of the customer key or a pre-aggregate
Why it works
Exactly. COUNT(*) counts rows. Fan-out is how “users” become a multiple.
What a good answer covers
- COUNT(*) = rows.
- People need a distinct key or a pre-agg.
- Name the fan-out.
- Bigger is not safer.
Answers that fall short
- Close, but not the strongest: Customers; SQL knows what I meant
SQL does not know your grain. - Weak: Nothing; COUNT is banned
COUNT is fine when the grain is honest. - Red flag: Five times the truth, which is more conservative
A multiple is not conservative; it is wrong.
Who gets asked this
More SQL questions
- “Orders on 1 September” differs in Tel Aviv and UTC. What do you write on the dashboard?
- SELECT customer_id, SUM(amount) without GROUP BY — what is wrong?
- You LEFT JOIN orders, then WHERE orders.status = 'paid'. What did you just do?
- 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?