Interview practice question
Where to put a "first order" flag
Data Engineering · Data Modeling · Beginner
Marketing wants to know if each order was the customer's first order. Where would you model this?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- It's an attribute of the order, so it belongs on the fact or an order-level table.
- Calculate with ROW_NUMBER over customer orders by date.
- Don't put it on the customer dimension.
- Recompute if earlier orders arrive late.
- Also useful: customer's first order date in the customer dimension.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.