Step 3: Data Modeling Fundamentals
Step 3: Data Modeling Fundamentals
Data modeling is the process of structuring data for ease of use. In analytical systems, we use the Star Schema.
ποΈ The Star Schema
A Star Schema consists of one Fact Table surrounded by multiple Dimension Tables.
1. Fact Tables
- Store the quantitative data (the βNumbersβ).
- Example:
Sales_Fact(Quantity, Total Amount, Discount). - Links to dimensions via Foreign Keys.
2. Dimension Tables
- Store the descriptive data (the βContextβ).
- Example:
Product_Dim(Name, Color, Category) orDate_Dim.
π Normalization vs. Denormalization
- OLTP (App DBs): Use 3rd Normal Form to reduce redundancy.
- OLAP (Data Warehouses): Use Denormalized Star Schemas to increase query speed.
π₯ Your Goal
- Draw a Star Schema for a library system (Facts: Book Loans, Dimensions: Books, Users, Dates).
- Understand what a Primary Key and Foreign Key are.