0
0
Snowflakecloud~5 mins

Views and materialized views in Snowflake - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a view in Snowflake?
A view is a saved SQL query that acts like a virtual table. It does not store data itself but shows data from underlying tables when queried.
Click to reveal answer
beginner
How does a materialized view differ from a regular view?
A materialized view stores the query result physically, so it can return data faster. Snowflake automatically refreshes it when the base tables change.
Click to reveal answer
intermediate
When should you use a materialized view instead of a regular view?
Use a materialized view when you want faster query performance on complex or large data sets and can accept some delay in data freshness.
Click to reveal answer
beginner
What happens when you query a regular view in Snowflake?
Snowflake runs the view's underlying SQL query on the current data each time you query the view, so results are always up-to-date.
Click to reveal answer
intermediate
How do you refresh a materialized view in Snowflake?
Materialized views are automatically refreshed by Snowflake based on changes to the base tables. You can also refresh them manually using the ALTER MATERIALIZED VIEW ... REFRESH command.
Click to reveal answer
What does a regular view in Snowflake store?
ANothing, it is just a name
BThe SQL query only, no data
CBoth query and data
DThe query result data physically
Which of the following is true about materialized views?
AThey always show real-time data
BThey cannot be refreshed
CThey store query results physically
DThey are slower than regular views
How do you update data in a materialized view?
AIt updates automatically with no action
BBy dropping and recreating the view
CBy running REFRESH MATERIALIZED VIEW
DBy updating the underlying tables only
Which scenario is best for using a materialized view?
AFor complex queries needing faster results
BFor simple queries on small tables
CWhen data freshness is critical
DWhen you want to save storage space
What happens when you query a regular view?
AIt requires manual refresh
BIt returns stored data instantly
CIt returns cached data only
DIt runs the underlying query on current data
Explain the difference between a view and a materialized view in Snowflake.
Think about how data is stored and updated.
You got /4 concepts.
    Describe when and why you would choose to use a materialized view over a regular view.
    Consider trade-offs between speed and data freshness.
    You got /4 concepts.