Star vs snowflake schemas
Data Modelling · 11 questions
Short notes
Key idea
A star schema keeps each dimension as one flat table joined directly to the fact. A snowflake splits dimensions further (product → category → department). Stars are simpler and faster to query; snowflakes save a little space.
Syntax
- Star: fact → dim_product(product, category, department). One join per dimension.
- Snowflake: fact → dim_product → dim_category → dim_department. Several joins.
- BI tools like Power BI and Looker work best with stars.
Example
"Revenue by department" in a star: one join, fact to dim_product, group by department. In a snowflake: three joins. On a modern columnar warehouse the repeated category text in a star costs almost nothing in storage.
Traps
- Snowflaking by habit from OLTP normalisation; analysts then write long join chains.
- A huge, fast-changing sub-dimension can justify a split; that's the exception.
- Joining two fact tables directly gives wrong totals; join them through shared (conformed) dimensions.
- Inconsistent dimension versions between teams break cross-report numbers.
Want the full lesson with step-by-step examples, a project and a certificate? Data Modelling course, ₹120 →
Questions
5 free questions- Question 1easy
In a star schema, how are dimensions stored?
- Question 2medium
Why does Power BI work best with a star schema?
- Question 3medium
fact_sales and fact_returns use different product tables with different ids. What problem does this cause?
- Question 4medium
In a snowflake, product links to category, and category links to department. How many joins does "revenue by department" need, starting from fact_sales?
- Question 5hard
Return
category,units_sold(sum of order_items.quantity) andlines_returned(count of returns rows) per product category, totalling each fact separately before joining. Include categories with no returns as 0.Write your answer on your own machine, then compare with the solution.
Star vs snowflake schemas
Star vs snowflake schemas
Star vs snowflake schemas
Star vs snowflake schemas
Star vs snowflake schemas
6 more questions on this topic, with hints, and tests
Sign up free for 21 days of every question and test.