Data modeling · Beginner
What is the difference between a star schema and a snowflake schema?
By Anurag Pandey, Lead Data Engineer ·
The short answer
In a star schema, a fact table joins directly to denormalized dimension tables. In a snowflake schema, dimensions are normalized into several related tables. Star means fewer joins and simpler queries; snowflake means less repeated data.
Opens this question on SpinTheMic. Start without signing up; sign in free for an AI report card.
Say it like this
About 50 seconds out loud. Use it as a model, then put it in your own words.
Both have a fact table in the middle with dimension tables around it. The difference is how the dimensions are stored. In a star schema, each dimension is one wide, denormalized table. A product dimension holds the product name, the category and the department in one table, so any query is just the fact table joined to each dimension once. In a snowflake schema, dimensions are normalized: product links to a category table, which links to a department table. That saves some repeated text, but every query needs more joins and is harder for analysts to write. For analytics I usually prefer a star schema, because it's simpler for BI tools and people, and in a columnar cloud warehouse the extra storage from repeated values is small.
What interviewers look for
- You describe the structure of both with one concrete example.
- You explain the trade-off: joins and simplicity against repeated data.
- You give a reasoned preference for your context.
Common mistakes
- Confusing the snowflake schema with the Snowflake data warehouse product.
- Saying a snowflake schema is always faster because it is normalized.
- Giving the definitions without saying which you would choose and why.
Follow-up questions to expect
- 1When would a snowflake schema make sense?
- 2How does columnar storage change the trade-off?
- 3What is a conformed dimension?
Opens this question on SpinTheMic. Start without signing up; sign in free for an AI report card.