0
0
Snowflakecloud~20 mins

Streams for change data capture in Snowflake - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Snowflake CDC Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
Understanding Stream Behavior on Table Updates

You have a Snowflake table users and a stream users_stream defined on it. After performing an UPDATE on some rows in users, what will SELECT * FROM users_stream return?

Snowflake
UPDATE users SET email = 'new@example.com' WHERE user_id = 123;
AIt returns the changed rows with both old and new values for the updated columns.
BIt returns only the new values of the updated rows without old values.
CIt returns all rows from the users table regardless of changes.
DIt returns an empty result because streams do not capture updates.
Attempts:
2 left
💡 Hint

Think about what a stream captures when rows are updated.

Architecture
intermediate
2:00remaining
Choosing Stream Type for CDC

You want to capture all changes (inserts, updates, deletes) on a Snowflake table for downstream processing. Which stream type should you create?

AA standard stream on the table.
BA materialized view on the table.
CA change tracking stream on the table.
DA transient table with triggers.
Attempts:
2 left
💡 Hint

Consider which stream type captures all DML changes.

security
advanced
2:00remaining
Stream Access Control

Which Snowflake privilege is required for a user to read data from a stream?

ASELECT privilege on the underlying table only.
BCREATE STREAM privilege on the database.
CUSAGE privilege on the stream and SELECT privilege on the underlying table.
DOWNERSHIP privilege on the stream only.
Attempts:
2 left
💡 Hint

Think about what permissions are needed to access both the stream and its data source.

Configuration
advanced
2:00remaining
Stream Behavior After Consuming Changes

What happens to the data in a Snowflake stream after you run SELECT * FROM stream_name without using DELETE or MERGE to consume the changes?

AThe stream data is cleared automatically after the SELECT.
BThe stream resets and starts capturing changes from scratch.
CThe stream data is lost and cannot be recovered.
DThe stream continues to show the same changes until they are consumed by DML statements.
Attempts:
2 left
💡 Hint

Consider how streams track consumption of changes.

Best Practice
expert
3:00remaining
Optimizing Stream Usage for Large Tables

You have a very large table with frequent changes and a stream defined on it. To minimize storage costs and improve performance, which practice is best when consuming stream data?

ARun <code>SELECT * FROM stream</code> multiple times before consuming changes.
BConsume stream data frequently using MERGE statements to clear changes promptly.
CDrop and recreate the stream daily to reset change tracking.
DDisable the stream when not in use to save storage.
Attempts:
2 left
💡 Hint

Think about how to keep stream data size manageable.