0
0
dbtdata~5 mins

Slowly changing dimensions (SCD Type 2) in dbt - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Slowly Changing Dimension (SCD) Type 2?
SCD Type 2 is a method to track historical changes in data by creating new records for each change instead of overwriting old data. This keeps full history of changes.
Click to reveal answer
beginner
Why use SCD Type 2 in data warehousing?
To keep a full history of changes in dimension data, allowing analysis of data as it was at any point in time.
Click to reveal answer
intermediate
In SCD Type 2, what columns are commonly added to track changes?
Columns like 'effective_date', 'end_date', and 'current_flag' are added to mark when a record is valid and if it is the current version.
Click to reveal answer
intermediate
How does dbt help implement SCD Type 2?
dbt automates SCD Type 2 using snapshots to detect changes and create new records.
Click to reveal answer
beginner
What is the difference between SCD Type 1 and Type 2?
Type 1 overwrites old data with new data (no history), while Type 2 keeps old data by adding new records for changes (full history).
Click to reveal answer
What does SCD Type 2 do when a dimension attribute changes?
AIgnores the change
BDeletes the old record
CUpdates the existing record
DCreates a new record with the change
Which column is NOT typically used in SCD Type 2?
Apassword
Beffective_date
Ccurrent_flag
Dend_date
In dbt, what feature helps implement SCD Type 2?
AIncremental models
BSnapshots
CSeeds
DTests
What is the main benefit of SCD Type 2?
AKeeping full history of changes
BLess storage space
CFaster queries
DSimpler data models
Which SCD type overwrites old data without keeping history?
AType 4
BType 2
CType 1
DType 3
Explain how Slowly Changing Dimension Type 2 works and why it is useful.
Think about how you keep old versions of a document instead of deleting them.
You got /4 concepts.
    Describe how you would implement SCD Type 2 using dbt.
    Consider how dbt can add new rows instead of replacing existing ones.
    You got /4 concepts.