0
0
Snowflakecloud~5 mins

Streams for change data capture in Snowflake - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Stream in Snowflake?
A Stream in Snowflake is a database object that tracks changes (inserts, updates, deletes) made to a table, allowing you to capture and process these changes incrementally.
Click to reveal answer
beginner
How does a Snowflake Stream help with Change Data Capture (CDC)?
It records the changes made to a table since the last time the stream was read, enabling efficient incremental data processing without scanning the entire table.
Click to reveal answer
beginner
What types of changes does a Snowflake Stream capture?
It captures INSERT, UPDATE, and DELETE operations performed on the source table.
Click to reveal answer
intermediate
What happens to the data in a Snowflake Stream after it is consumed?
After the stream data is consumed (read), the stream marks those changes as processed, so the next read only returns new changes.
Click to reveal answer
intermediate
Can a Snowflake Stream be used on a table with no primary key?
Yes, but without a primary key, it may be harder to uniquely identify rows for updates or deletes, so best practice is to have a primary key for accurate CDC.
Click to reveal answer
What does a Snowflake Stream track?
AUser login history
BQuery execution plans
CTable schema changes
DChanges made to a table since last read
Which operations are captured by a Snowflake Stream?
AOnly INSERTs
BOnly DELETEs
CINSERT, UPDATE, DELETE
DOnly UPDATEs
What happens when you read data from a Snowflake Stream?
AThe stream resets and loses all data
BThe changes are marked as consumed and won't appear again
CThe source table is deleted
DThe stream duplicates the data
Why is having a primary key recommended when using Streams for CDC?
ATo uniquely identify rows for accurate change tracking
BTo speed up queries unrelated to CDC
CTo prevent data from being deleted
DTo encrypt the data
Can a Snowflake Stream be created on a view?
ANo, streams only work on tables
BOnly on external tables
COnly on materialized views
DYes, streams work on views
Explain how Snowflake Streams enable change data capture and why they are useful.
Think about how you would keep track of changes in a spreadsheet without copying the whole sheet every time.
You got /4 concepts.
    Describe the lifecycle of data in a Snowflake Stream from creation to consumption.
    Imagine a mailbox that collects letters until you check it, then it empties for new letters.
    You got /5 concepts.