Slowly Changing Dimensions (SCDs) are a family of design patterns in dimensional data modeling — first formalized by Ralph Kimball — that govern how a data warehouse responds when descriptive attributes of dimension records change over time. Choosing the wrong SCD type silently corrupts historical reporting: a fact joined to an overwritten dimension loses the state that was true when the transaction occurred. The core trade-off is storage and complexity versus historical fidelity — and the patterns range from "never change anything" (Type 0) through full bi-temporal bookkeeping that tracks both real-world time and system-record time independently.
What This Cheat Sheet Covers
This topic spans 14 focused tables and 82 indexed concepts, 76 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Core SCD Types Overview
The seven canonical SCD types each represent a distinct policy for handling attribute changes. Understanding when each is appropriate is more important than memorizing their mechanics.
| Type | Example | Description | |
|---|---|---|---|
INSERT new row; UPDATE old row SET end_date = today, is_current = FALSE | • Most widely used pattern. Preserves full history by inserting a new row for each change while closing the prior row with an end_date• enables accurate point-in-time reporting | ||
UPDATE customers SET address = '123 New St' WHERE customer_id = 101 | • Destroys history — overwrites the existing value in place • use only when correcting bad data or when history is genuinely irrelevant | ||
Column date_of_birth is never updated after initial insert | • The attribute value never changes once set • facts are always grouped by the original value • Suitable for truly immutable attributes such as SSN or original credit score | ||
ALTER TABLE employees ADD COLUMN prev_department VARCHAR(100);UPDATE employees SET prev_department = current_department, current_department = 'Finance' | • Stores only one prior value in a new column • trades full history for simpler queries • suited to exactly-two-value comparisons (current vs. previous). | ||
Separate mini_dim_customer_profile table with surrogate key referenced from fact table | • Splits rapidly or frequently changing attributes into a separate mini-dimension to avoid bloating the base dimension • both base and mini-dimension surrogate keys appear in the fact table | ||
Type 2 row with added current_value column overwritten Type 1; name = 2+3+1 = 6 also 2×3×1 = 6 | Combines Type 2 row versioning with a Type 1 overwritten current-value column so every historical row also shows the attribute's current value, enabling both as-was and as-is reporting in one table. | ||
Fact table holds two FKs: dim_sk (version surrogate) + durable_sk (links to current row) | • Achieves the same dual reporting as Type 6 but via two foreign keys in the fact table rather than physically overwriting columns in every historical row • avoids mass updates | ||
Base dim embeds current_profile_sk (Type 1 overwrite) referencing the mini-dimension | • Extends Type 4 by embedding a Type 1 current-profile key in the base dimension so current mini-dimension values are accessible without joining through the fact table • Named 5 because 4+1=5. |