All jobs / Data analyst / BI / SQL
Data analyst / BI interview question · 0–1 years
You need last month’s paid orders joined to customers. Where does the date filter go?
The strongest answer
On the orders side, before or in the join logic, so you do not multiply then “filter the mess” — and you say whether cancelled rows count
Why it works
Exactly. Filter the fact at the right grain. Chart-only filters are how extracts lie.
What a good answer covers
- Filter the fact at its grain.
- Say who is excluded.
- Do not leave it to the chart.
- Caches are not a where clause.
Answers that fall short
- Close, but not the strongest: On the final SELECT only, after a cross-join vibe
A late filter on a multiplied table is a different number. - Weak: In the chart filter, so SQL stays “clean”
The warehouse should know the question. - Red flag: Nowhere; last month is implied by the dashboard cache
Caches are not definitions.
Who gets asked this
More SQL questions
- 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?
- 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?