0
0
Snowflakecloud~20 mins

Views and materialized views in Snowflake - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Views and Materialized Views Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
Materialized View Refresh Behavior

In Snowflake, what happens when you query a materialized view that is not yet refreshed after the base table has changed?

AThe query automatically triggers a full refresh of the materialized view before returning data.
BThe query returns the data from the last refresh, ignoring recent changes in the base table.
CThe query returns an error indicating the materialized view is stale.
DThe query returns the latest data from the base table directly, bypassing the materialized view.
Attempts:
2 left
💡 Hint

Think about how materialized views store data separately and when they update.

Architecture
intermediate
2:00remaining
Choosing Between Views and Materialized Views

You have a large table that updates frequently. You want to optimize query speed for a complex aggregation that is used often. Which approach is best in Snowflake?

ACreate a copy of the table with precomputed aggregation and update it manually.
BUse a temporary table to store aggregation results for each query.
CCreate a materialized view with the aggregation to speed up queries but refresh it regularly.
DCreate a standard view with the aggregation query to always get fresh data.
Attempts:
2 left
💡 Hint

Consider trade-offs between query speed and data freshness.

security
advanced
2:00remaining
Access Control on Views vs Materialized Views

In Snowflake, if a user has SELECT privilege on a base table but no privileges on a materialized view built on that table, what happens when the user tries to query the materialized view?

AThe query fails with an access denied error on the materialized view.
BThe query succeeds because the user has access to the base table data.
CThe query succeeds but returns no rows.
DThe query triggers a privilege escalation warning but returns data.
Attempts:
2 left
💡 Hint

Think about how Snowflake enforces privileges on objects.

Configuration
advanced
2:00remaining
Materialized View Refresh Scheduling

Which Snowflake feature allows automatic refresh of materialized views without manual intervention?

AUsing Snowflake Tasks to schedule refresh commands.
BSetting the materialized view property AUTO_REFRESH = TRUE.
CEnabling continuous data protection on the base table.
DConfiguring the warehouse to auto-scale during queries.
Attempts:
2 left
💡 Hint

Think about how to automate SQL commands in Snowflake.

🧠 Conceptual
expert
2:00remaining
Impact of Materialized Views on Storage and Compute Costs

Which statement best describes the cost implications of using materialized views in Snowflake compared to standard views?

AMaterialized views have no impact on storage costs but increase compute costs due to refresh overhead.
BMaterialized views reduce both storage and compute costs by compressing data more efficiently than base tables.
CMaterialized views increase compute costs because queries always trigger a full refresh.
DMaterialized views increase storage costs because they store data, but reduce compute costs by speeding up queries.
Attempts:
2 left
💡 Hint

Consider what materialized views store and how they affect query processing.