Star Schema
The star schema is the simplest and most common data warehouse schema. It's characterized by a central fact table surrounded by several dimension tables. This structure resembles a star, hence the name.
Structure of a Star Schema
A star schema consists of two main types of tables:
- Fact Table: Located at the center of the schema. It contains quantitative data (measures) and foreign keys that link to the dimension tables. Fact tables are typically large and grow rapidly.
- Dimension Tables: These tables surround the fact table and provide descriptive context for the facts. Each dimension table contains a primary key and descriptive attributes. Common dimensions include time, product, customer, and geography.

A typical star schema structure.
Key Characteristics
- Denormalized Dimension Tables: Dimension tables in a star schema are typically denormalized. This means that related data is kept within a single dimension table, even if it introduces redundancy. This leads to fewer joins and faster query performance.
- Simple Queries: The straightforward structure makes it easy to write and understand queries.
- Performance: Denormalization and the limited number of joins generally result in excellent query performance.
- Ease of Understanding: The intuitive design makes it accessible for business users to understand the data model.
Example
Consider a retail data warehouse. A star schema for sales might look like this:
- Fact Table:
SalesFact
ProductID
(Foreign Key)CustomerID
(Foreign Key)DateID
(Foreign Key)StoreID
(Foreign Key)SalesAmount
(Measure)QuantitySold
(Measure)
- Dimension Tables:
ProductDimension
(ProductID
,ProductName
,Category
,Brand
)CustomerDimension
(CustomerID
,CustomerName
,City
,Country
)DateDimension
(DateID
,Day
,Month
,Year
,DayOfWeek
)StoreDimension
(StoreID
,StoreName
,Region
)
A query to find the total sales amount for a specific product category in a given year might involve joining the SalesFact
table with ProductDimension
and DateDimension
. Because the dimension tables are denormalized, this typically requires only two joins.
Advantages of Star Schema
- Simplicity: Easy to design, understand, and implement.
- Query Performance: Optimized for read-heavy analytical queries due to fewer joins.
- Business User Friendliness: Maps well to business processes and is easier for non-technical users to navigate.
Disadvantages of Star Schema
- Data Redundancy: Denormalization can lead to data redundancy, which might increase storage costs and the risk of data inconsistencies if not managed carefully.
- Less Flexible for Complex Hierarchies: For deeply nested or complex hierarchical data, a snowflake schema might be more appropriate.
Tip:
When designing dimension tables, aim to include all relevant descriptive attributes that a business user might need to slice and dice the data. This denormalization is key to the star schema's performance benefits.
The star schema is an excellent choice for many data warehousing scenarios, especially when the focus is on providing fast and intuitive access to business performance metrics.