
Star Schema vs Snowflake Schema: Differences, SQL Examples, and When to Use Each
A star schema and a snowflake schema both organize a data warehouse around a central fact table of measurements surrounded by dimension tables that describe them. The difference is in the dimensions: a star schema keeps each dimension in one flat, denormalized table, while a snowflake schema splits dimensions into several normalized tables linked by keys.
This guide compares the two designs side by side, shows the same sales model built both ways in SQL, and explains when each one is the better choice.
Key Points
- A star schema joins the fact table directly to one table per dimension, so queries need fewer joins and are easier to read.
- A snowflake schema normalizes dimensions into sub-tables, such as product, category, and department, which reduces repeated values but adds joins.
- Both designs can hold exactly the same information; they differ in how it is stored and how easy it is to query.
- Star schema is the common default for analytics and BI tools; snowflaking is usually limited to specific dimensions with a clear reason.
Quick summary: Star schema favors simple, fast queries. Snowflake schema favors less duplication and tighter structure in the dimensions.
Key takeaway: Start with a star schema, and only normalize a dimension when its size, its update pattern, or a shared hierarchy gives you a concrete reason.
What Is a Star Schema?
A star schema is a dimensional model with one fact table in the center and dimension tables around it, which gives the diagram its star shape. The fact table stores events or measurements, such as sales amounts and quantities, plus a key column for each dimension. Each dimension table stores descriptive attributes, such as product name, category, store city, or calendar month, that people use to filter and group results.
The Kimball Group, whose methods shaped dimensional modeling, describes star schemas as fact tables linked to their dimension tables through primary and foreign key relationships. Dimension tables are deliberately denormalized: a product row repeats its category and department names instead of pointing to separate tables.
What Is a Snowflake Schema?
A snowflake schema starts from the same fact table but normalizes some or all of the dimensions. A product dimension, for example, might keep only product attributes and a category key, with category and department moved into their own tables. Each extra level branches out from the dimension, so the diagram looks like a snowflake.
Normalizing removes repeated text from the dimensions and gives each hierarchy level a single place to be updated. The cost is more tables and more joins for every query that needs those attributes.
Star Schema vs Snowflake Schema: Key Differences
Here is how the two designs compare on the points that matter most in practice:
| Factor | Star schema | Snowflake schema |
|---|---|---|
| Dimension structure | One denormalized table per dimension | Dimensions split into normalized sub-tables |
| Joins per query | Fewer: fact to each dimension | More: fact to dimension to sub-tables |
| Repeated values | More, such as category names on every product row | Less, each value stored once |
| Ease of use for analysts | Simpler to read and query | Harder to navigate |
| Maintenance of hierarchies | Changes may touch many dimension rows | Changes happen in one small table |
| Typical use | BI dashboards, reporting, semantic models | Large or shared dimensions with deep hierarchies |
Storage savings from snowflaking are usually small, because dimension tables are much smaller than fact tables. That is why query simplicity tends to win in modern warehouses.
SQL Example: The Same Sales Model Built Both Ways
Imagine a retail company that wants to report revenue by product category, store region, and month. Below is a simplified version of the model in each design.
Star schema tables
CREATE TABLE dim_product (
product_key INT PRIMARY KEY,
product_name VARCHAR(100),
category_name VARCHAR(50),
department VARCHAR(50)
);
CREATE TABLE dim_store (
store_key INT PRIMARY KEY,
store_name VARCHAR(100),
city VARCHAR(50),
region VARCHAR(50)
);
CREATE TABLE dim_date (
date_key INT PRIMARY KEY,
full_date DATE,
month_name VARCHAR(20),
year_number INT
);
CREATE TABLE fact_sales (
date_key INT REFERENCES dim_date (date_key),
product_key INT REFERENCES dim_product (product_key),
store_key INT REFERENCES dim_store (store_key),
quantity INT,
revenue DECIMAL(12,2)
);
Snowflake schema tables
The fact table and the date and store dimensions stay the same. Only the product dimension is normalized into three tables:
CREATE TABLE dim_department (
department_key INT PRIMARY KEY,
department_name VARCHAR(50)
);
CREATE TABLE dim_category (
category_key INT PRIMARY KEY,
category_name VARCHAR(50),
department_key INT REFERENCES dim_department (department_key)
);
CREATE TABLE dim_product (
product_key INT PRIMARY KEY,
product_name VARCHAR(100),
category_key INT REFERENCES dim_category (category_key)
);
The same report in each design
Revenue by category and month in the star schema needs one join per dimension:
SELECT p.category_name,
d.month_name,
SUM(f.revenue) AS total_revenue
FROM fact_sales f
JOIN dim_product p ON f.product_key = p.product_key
JOIN dim_date d ON f.date_key = d.date_key
GROUP BY p.category_name, d.month_name;
In the snowflake schema, the same question needs an extra join to reach the category name:
SELECT c.category_name,
d.month_name,
SUM(f.revenue) AS total_revenue
FROM fact_sales f
JOIN dim_product p ON f.product_key = p.product_key
JOIN dim_category c ON p.category_key = c.category_key
JOIN dim_date d ON f.date_key = d.date_key
GROUP BY c.category_name, d.month_name;
Both queries return the same numbers. Add department to the report and the snowflake query needs a fourth join, while the star query only adds a column. Across many dashboard queries, that difference adds up in readability and, often, in performance.
Fact Tables vs Dimension Tables
Both schemas depend on getting this split right, so it is worth stating clearly:
| Aspect | Fact table | Dimension table |
|---|---|---|
| Stores | Events and measurements | Descriptive context |
| Examples | Sales, clicks, payments, shipments | Product, customer, store, date |
| Typical columns | Dimension keys plus numeric measures | One key plus text and category attributes |
| Size | Many rows, keeps growing | Fewer rows, changes more slowly |
| Used for | Summing, counting, averaging | Filtering, grouping, labeling |
Microsoft’s guide to star schema for Power BI uses the same split: dimension tables describe business entities, and fact tables store observations or events. When dimension attributes change over time, such as a customer moving to a new city, you also need a plan for history. Our guide to slowly changing dimensions Type 2 with SQL and dbt shows one common approach.
When to Use Each Schema
Choose a star schema when
- analysts and BI tools query the model directly and need it to be easy to understand;
- dashboard speed matters and you want to keep joins to a minimum;
- dimensions are small or medium in size, so repeated values cost little;
- you are building the business-ready layer of a warehouse or lakehouse.
Consider a snowflake schema when
- a dimension is very large and many attributes repeat across millions of rows;
- several dimensions share the same hierarchy, such as a geography table used by both stores and customers;
- hierarchy levels change often and must be updated in one place;
- the model mainly feeds other pipelines rather than people writing queries.
Many real models are a hybrid: mostly star, with one or two snowflaked dimensions where there is a clear reason. The Kimball Group advises avoiding snowflaked dimensions in most cases, because they are harder for business users to navigate and can slow queries, and a flattened dimension holds exactly the same information.
Snowflake Schema vs the Snowflake Data Platform
The names overlap, but they are different things. A snowflake schema is a data modeling pattern that works in any relational database. Snowflake is a cloud data platform, and you can build a star schema, a snowflake schema, or any other model inside it. If you are learning the platform itself, our article on Snowflake data warehouse architecture explains how it stores and processes data.
Where These Schemas Fit in a Modern Data Stack
Dimensional models still sit at the end of most analytics pipelines, even when the raw data lives in a lakehouse. In a medallion architecture, for example, star schema tables often make up the gold layer that dashboards read. On top of those tables, a semantic layer can define shared metrics so every BI tool calculates revenue the same way.
How Star and Snowflake Schemas Come Up in Data Engineering Interviews
Schema design is a common topic in data modeling and system design rounds. Be ready to:
- explain the difference between facts and dimensions with an example from a real business process;
- choose the grain of a fact table, such as one row per order line, and say why;
- justify star or snowflake for a given scenario, including the join and maintenance trade-offs;
- describe how you would handle a dimension attribute that changes over time.
For more modeling patterns beyond these two schemas, read our guide to advanced data modeling techniques. If you want structured feedback on your modeling answers or a portfolio project, DE Academy offers personalized training.
Frequently Asked Questions
A star schema stores each dimension in one denormalized table joined directly to the fact table. A snowflake schema normalizes dimensions into several related tables, so queries need more joins but dimension values are stored only once.
Snowflake schemas add joins, which makes queries longer and harder for analysts to write, and they can slow down reporting. The Kimball Group recommends avoiding snowflaked dimensions in most cases, since a flattened dimension holds the same information.
The three types most often listed are the star schema, the snowflake schema, and the galaxy schema, also called a fact constellation, where several fact tables share the same dimension tables.
Often, yes, for analytical queries, because it needs fewer joins. The real difference depends on the database engine, the data volume, and how the queries are written, so test with your own workload when performance is critical.
It depends on the use case. Some teams use one wide denormalized table for simple dashboards, a Data Vault model for raw integration layers, or a snowflake schema for specific large dimensions. For most BI reporting, a star schema remains the common default.
Start With a Star, Snowflake Only With a Reason
Star and snowflake schemas solve the same problem: making measurements easy to analyze by their context. A star schema keeps that context in flat, easy-to-join tables, which is why it is the usual starting point. Normalize a dimension when you have a specific reason, and be ready to explain that reason clearly in a design review or an interview.
ABOUT THE AUTHOR

