CREATE VIEW defines a named, reusable virtual table based on a SELECT query in Snowflake.
How to CREATE VIEW in Snowflake
CREATE VIEW lets you store complex SELECT logic as a reusable, secure object.
Encapsulate business logic, simplify queries, and control column exposure without replicating data. Views update automatically when underlying data changes, saving maintenance time.
Snowflake supports OR REPLACE, SECURE, RECURSIVE, COPY GRANTS, and more.See the detailed syntax section below.
Use CREATE VIEW view_name AS SELECT ... to expose frequently used joins or filters. Example shown in the next section.
Yes—use CREATE OR REPLACE VIEW. It swaps the definition atomically while keeping the name constant. Combine with COPY GRANTS to retain privileges.
Choose SECURE to prevent exposing underlying table data to unauthorized roles.Secure views are required for data that leaves your Snowflake account (e.g., data shares).
The sample query in the example section builds a view showing lifetime spend per customer, ready for dashboards or analysts.
1) Name views with business-friendly prefixes (vw_ or v_). 2) Keep SELECT statements deterministic. 3) Avoid ORDER BY unless paired with LIMIT.4) Document columns with comments.
See the dedicated mistake section below for quick fixes.
Scroll to the FAQ section for answers on performance, limits, and altering view definitions.
.
No. A view is virtual; it runs the underlying SELECT at query time.
Performance matches the optimised SELECT plan. Materialise complex logic into a table if latency becomes critical.
Use CREATE OR REPLACE VIEW. ALTER VIEW only renames or adds comments; it cannot change the SELECT.