0
0
dbtdata~5 mins

Snapshot tables for historical tracking in dbt - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a snapshot table in dbt?
A snapshot table in dbt is a special table that records changes in source data over time, allowing you to track historical versions of records.
Click to reveal answer
beginner
Why do we use snapshot tables for historical tracking?
We use snapshot tables to keep a history of data changes, so we can see how data looked at different points in time, which helps in auditing and analysis.
Click to reveal answer
intermediate
What are the two main strategies for snapshots in dbt?
The two main strategies are 'timestamp' and 'check'. 'Timestamp' tracks changes based on a timestamp column, while 'check' compares specified columns for changes.
Click to reveal answer
intermediate
How does the 'check' strategy detect changes in a snapshot?
The 'check' strategy compares specified columns in the source data to detect any changes. If any column value changes, dbt records a new version in the snapshot table.
Click to reveal answer
beginner
What columns does dbt add automatically to a snapshot table?
dbt adds columns like 'dbt_valid_from' and 'dbt_valid_to' to mark the time range when a record version was valid, helping track the history clearly.
Click to reveal answer
What is the main purpose of a snapshot table in dbt?
ATo create backups of the database
BTo track historical changes in data over time
CTo delete old data automatically
DTo speed up query performance
Which snapshot strategy in dbt uses a timestamp column to detect changes?
ACheck
BIncremental
CMerge
DTimestamp
What does the 'check' strategy compare to detect changes?
AOnly timestamp columns
BOnly primary key columns
CAll specified columns for any difference
DRow counts
Which columns does dbt add to snapshot tables to track validity periods?
Adbt_valid_from and dbt_valid_to
Bcreated_at and updated_at
Cstart_date and end_date
Dvalid_from and valid_until
When should you use snapshot tables in your data project?
AWhen you want to track how data changes over time
BWhen you want to delete old data
CWhen you want to speed up data loading
DWhen you want to create indexes
Explain what a snapshot table is and why it is useful for historical tracking in data projects.
Think about how you can see past versions of data.
You got /3 concepts.
    Describe the difference between the 'timestamp' and 'check' snapshot strategies in dbt.
    Consider how each detects changes in data.
    You got /3 concepts.