All jobs / Data analyst / BI / SQL
Data analyst / BI interview question · 0–1 years
A stakeholder asks for “orders per customer.” What do you pin down first?
The strongest answer
The grain — one row per order, per customer-day, or per customer-lifetime — then the join, not a chart that silently mixes them
Why it works
Exactly. Grain is the question. A pretty mix of grains is how two people get two numbers.
What a good answer covers
- Name the grain first.
- Then join.
- Do not mix grains in one number.
- Do not average averages to paper over it.
Answers that fall short
- Close, but not the strongest: The colour of the bar chart
Colour is not a definition. - Weak: A count(*) on whatever table is nearest
Nearest table is how you double-count. - Red flag: An average of averages so it “feels right”
Averaging averages hides the grain.
Who gets asked this
More SQL questions
- When do you use LEFT JOIN instead of INNER?
- You need last month’s paid orders joined to customers. Where does the date filter go?
- A join fans one customer into five rows. What does COUNT(*) now mean?
- “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?