# Star Schema

> One fact table in the middle. Each dimension table joins straight to it.

**Field:** Data Engineering  
**Category:** Storage & Warehousing

## Think of it like

It is like a wheel. The hub is in the middle, and each spoke goes straight out to the rim.

## Definition

A star schema puts one fact table in the middle and dimension tables around it. Each dimension joins straight to the fact table with one key. Dimensions are not split further, so each one is a single wide table. Queries need only one join per dimension. Drawn out, it looks like a star.

## Example

A shop's star has a sales fact table in the middle. Date, shop, product and customer tables sit around it.

## Example code

```sql
SELECT d.month, p.brand, SUM(f.amount)
FROM fact_sales f
JOIN dim_date d ON f.date_key = d.date_key
JOIN dim_product p ON f.product_key = p.product_key
GROUP BY d.month, p.brand;
```

Sales by month and brand. One join for each dimension.

## Why it matters

It is simple for people and fast for warehouses. Most BI tools are built to read it.

## Common mistake

Joining two fact tables to each other directly. Facts should meet only through shared dimensions.

## Three principles

- **Fact in the middle.** One table of events.
- **One join each.** Dimensions join straight to the fact.
- **Flat dimensions.** Each dimension is one wide table.

## Related terms

- [Snowflake Schema](https://learn.benibix.com/term/data/snowflake-schema)
- [Fact Table](https://learn.benibix.com/term/data/fact-table)
- [Dimension Table](https://learn.benibix.com/term/data/dimension-table)
- [Dimensional Modeling](https://learn.benibix.com/term/data/dimensional-modeling)
- [SQL Join](https://learn.benibix.com/term/development/join)
- [One Big Table (OBT)](https://learn.benibix.com/term/data/one-big-table)
- [Data Vault](https://learn.benibix.com/term/data/data-vault)

## Told apart from

- [Star Schema vs Snowflake Schema](https://learn.benibix.com/compare/star-schema-vs-snowflake-schema): People think a snowflake schema is better because it stores less. It splits dimensions into more tables, so each name sits in one place. A star schema keeps each dimension in one wide table. That means fewer joins and simpler queries, which is why most teams pick the star.
- [One Big Table vs Star Schema](https://learn.benibix.com/compare/one-big-table-vs-star-schema): People think one big table is just a messy star schema. Both hold the same facts and details. A star schema keeps each detail table apart and joins them when you ask. One big table does the joins once, ahead of time, and keeps the result. The star is easier to change. The big table is easier to query.

![Left: a star schema, with a sales fact table in the middle and four dimension tables around it, each joined straight to the fact. Right: a snowflake schema, where the product dimension is split further into a category table.](https://learn.benibix.com/diagrams/star-vs-snowflake-schema.svg)

---

Source: https://learn.benibix.com/term/data/star-schema
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
