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?
UPDATE users SET email = 'new@example.com' WHERE user_id = 123;
Think about what a stream captures when rows are updated.
Snowflake streams capture change data including both old and new values for updated rows, allowing you to see what changed.
You want to capture all changes (inserts, updates, deletes) on a Snowflake table for downstream processing. Which stream type should you create?
Consider which stream type captures all DML changes.
Standard streams capture inserts, updates, and deletes for CDC. Change tracking streams only track row-level changes without old values.
Which Snowflake privilege is required for a user to read data from a stream?
Think about what permissions are needed to access both the stream and its data source.
To read from a stream, a user needs USAGE privilege on the stream itself and SELECT privilege on the underlying table.
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?
Consider how streams track consumption of changes.
Streams retain change data until it is consumed by DML operations like DELETE or MERGE. A simple SELECT does not consume changes.
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?
Think about how to keep stream data size manageable.
Frequent consumption of stream data using MERGE or DELETE clears the change data, reducing storage and improving performance.