Modelling a business from scratch
Data Modelling · 12 questions
Short notes
Key idea
Modelling a business from scratch follows a repeatable path: pick a business process, declare the grain, choose the dimensions, then the facts. Start from the questions people ask, not from the source tables.
Syntax
- List the questions ("revenue by city by month", "repeat customers").
- Pick the process: orders, payments, deliveries.
- Declare the grain: one row per order line.
- Dimensions: date, customer, product, store, channel.
- Facts: qty, amount, discount.
- Conformed dimensions shared across facts (the same dim_customer for orders and payments).
- Check each original question can be answered.
Example
A food delivery app: fact_orders (order grain: amount, fee, delivery minutes) and fact_ratings (rating grain). Both share dim_customer, dim_restaurant and dim_date, so "rating vs delivery time by restaurant" is possible.
Traps
- Copying the app's tables into the warehouse unchanged gives an OLTP model, not an analytical one.
- Skipping the grain leads to mixed-grain facts.
- Different "customer" tables per team give different numbers for the same question.
- Model for questions you have now, but at the lowest grain so new ones fit.
Want the full lesson with step-by-step examples, a project and a certificate? Data Modelling course, ₹120 →
Questions
5 free questions- Question 1easy
An interviewer says "Design the data model for an online pharmacy." What should you do first?
- Question 2medium
Why model orders and deliveries as separate fact tables in a food delivery app?
- Question 3medium
A ride-hailing company wants surge patterns by hour of day. What should the model include?
- Question 4hard
A hospital needs bed occupancy for every ward on every day. Which fact table fits?
- Question 5medium
For a ride-hailing app's trips fact, which set are dimensions?
Modelling a business from scratch
Modelling a business from scratch
Modelling a business from scratch
Modelling a business from scratch
Modelling a business from scratch
7 more questions on this topic, with hints, and tests
Sign up free for 21 days of every question and test.