Courses / Course 03
Data Modelling
Shape data so people can query it without a guide: facts, dimensions and history.
- IntermediateLevel
- about 1.5 hoursTo complete
- 6 lessonsWith checked exercises
- FreeNo account needed
What you will learn
- Choose and test the grain of a table
- Build fact and dimension tables
- Answer questions with a star schema
- Keep full history with SCD Type 2
- Write point-in-time joins
Syllabus
- 1Why model data? Start with the grain12 min
Source systems store data for running the business. Analytics needs it shaped differently, and every good model starts with one question: what is one row?
- 2Fact tables14 min
Facts record events and the numbers you add up: here, every product sold in a delivered order.
- 3Dimension tables14 min
Dimensions describe the who, what and when of each fact, and make filtering and grouping easy.
- 4The star schema12 min
Put facts and dimensions together, and most business questions become a join and a GROUP BY.
- 5Keeping history: slowly changing dimensions16 min
Customers move and change plans. Keep every version, so old reports stay true.
- 6Mini project: revenue by where customers really lived20 min
Join facts to the version of the customer that was true on the day of each order.
The data you will use
Nordic Shop
A small online shop based in Finland that sells electronics, home goods, sports gear, books and outdoor clothing. Customers sign up, place orders on the website or in the app, and each order contains one or more products.
Tables: customers, products, orders, order_items
Nordic Shop raw feeds
The same Nordic Shop, but before anyone cleaned the data. Every night a job loads the day's orders from the shop system, the payment provider sends its own file, and the customer system keeps a log of every change to a customer.
Tables: raw_orders_feed, payments, customer_history, order_events, customer_contacts, deletion_requests
The lesson Keeping history: slowly changing dimensions walks you through every table and column. Under every code box you can also open a list of the tables and what each column means.
Learn in public on GitHub
Do the exercises in the browser, or in the public course repo so your work shows on your GitHub profile.
Fork the course repo
One click on GitHub gives you your own copy with every exercise and dataset.
Solve and open a pull request
Put your answers in your own folder and open a pull request. A bot checks them and comments with ✅ or ❌.
Join the graduates
Finished a course? Add your name to GRADUATES.md. Your work stays on your GitHub profile for recruiters to see.
What you will build
A star schema with full customer history for an online shop.
Based on a real project: E-commerce CDC Pipeline