Skip to content

Snowflake is a cloud data platform, provided as a service, that stores data and runs SQL on it. The data sits in storage that Snowflake manages, and queries run on virtual warehouses, which are compute clusters you start, stop, and pay for by the second. Objects are organized as account, database, schema, and then tables and views, and access is granted to roles. This beginner's guide explains each part and the first statements to run.

All SQL here is Snowflake SQL taken from Snowflake's documentation on November 22, 2026. None of it was run, and no prices are quoted. For related guides, see the Snowflake hub.

How Snowflake is built: storage, compute, and cloud services

Snowflake's documentation describes the architecture as a hybrid: a central data repository that every compute node can reach, as in a shared-disk database, queried by massively parallel processing (MPP) clusters, as in a shared-nothing database. It has three layers.

  • Database storage. When data is loaded into a table, Snowflake reorganizes it into a compressed, columnar format in cloud storage, and manages the file size, structure, compression, and metadata itself.
  • Compute. A virtual warehouse is a cluster of compute resources that processes SQL statements. Each warehouse shares no compute with the others, so one does not slow another down.
  • Cloud services. This layer coordinates the rest: sign-in, access control, metadata, and query parsing and optimization.

An account is hosted on Amazon Web Services, Google Cloud, or Microsoft Azure, and Snowflake cannot be installed on-premises or on private cloud infrastructure.

Virtual warehouses and how compute is billed

A warehouse is required for queries and for all DML (data manipulation language) operations, including loading data. Compute is paid for in credits, Snowflake's unit of measure for resources consumed, under these rules:

  • A running warehouse consumes credits whether or not it is doing work. A suspended one uses none.
  • Billing is per second, with a 60-second minimum each time a warehouse starts or resumes.
  • Each step up in size roughly doubles the compute power and the credits billed per hour.
  • Cloud services usage is charged only when it exceeds 10% of that day's warehouse usage.

What a credit costs depends on your edition, region, and whether the account is On Demand or Capacity, and storage is billed separately. These properties control a warehouse:

PropertyWhat it controlsDefault in CREATE WAREHOUSE
WAREHOUSE_SIZECompute resources per cluster, and so credits consumed while runningXSMALL
AUTO_SUSPENDSeconds of inactivity before the warehouse suspends. 0 or NULL means never600
AUTO_RESUMEWhether a submitted statement restarts a suspended warehouseTRUE
MAX_CLUSTER_COUNTClusters in a multi-cluster warehouse, for concurrency. Values above 1 need Enterprise Edition or higher1
-- Snowflake SQL. CREATE is from Snowflake's "Snowflake in 20 minutes" tutorial;
-- ALTER is adapted from the ALTER WAREHOUSE reference. Not run.
CREATE OR REPLACE WAREHOUSE sf_tuts_wh WITH
   WAREHOUSE_SIZE='X-SMALL'
   AUTO_SUSPEND = 180
   AUTO_RESUME = TRUE
   INITIALLY_SUSPENDED=TRUE;

-- Resume and suspend by hand:
ALTER WAREHOUSE sf_tuts_wh RESUME IF SUSPENDED;
ALTER WAREHOUSE sf_tuts_wh SUSPEND;

OR REPLACE drops an existing object of the same name first. The process that suspends idle warehouses runs about every 30 seconds, so AUTO_SUSPEND is not exact. Because the 60-second minimum starts over on every resume, a warehouse that suspends and resumes within a minute is charged more than once. A warehouse can be resized while running, but Snowflake notes that larger is not necessarily faster for small, basic queries.

The object hierarchy: account, database, schema, table, view

Tables, views, and stages live in a schema, schemas live in a database, and all databases belong to the account.

LevelWhat it is forCreated with
AccountContains all of your databases. The organization is the container above itSigning up, not SQL
DatabaseA logical grouping of schemas. A new database gets a PUBLIC schema and an INFORMATION_SCHEMA of metadata viewsCREATE DATABASE
SchemaA logical grouping of tables, views, and other objectsCREATE SCHEMA
TableStores rows. Permanent unless declared temporary or transientCREATE TABLE
ViewA named query. A standard view stores no results; they are computed when it is queriedCREATE VIEW

A database and schema together form a namespace, and a fully qualified name reads my_database.my_schema.my_table. In a session, USE DATABASE and USE SCHEMA set the namespace so short names resolve.

On standard tables, Snowflake does not enforce PRIMARY KEY, UNIQUE, or FOREIGN KEY constraints. Only NOT NULL and CHECK are enforced, so test uniqueness yourself. For table layout, see data warehouse schema design.

Roles and grants

Snowflake uses role-based access control: privileges on objects are granted to roles, and roles are granted to users. Access is denied unless a grant allows it. Each object is owned by one role, by default the role that created it, and USE ROLE changes a session's primary role.

Every account has system-defined roles:

  • ACCOUNTADMIN: the top-level role, meant for a limited number of users.
  • SECURITYADMIN: can manage any grant, and users and roles.
  • USERADMIN: creates users and roles.
  • SYSADMIN: creates warehouses, databases, and other objects.
  • PUBLIC: granted automatically to every user and role.

To query a table, a role needs USAGE on a warehouse, USAGE on the database and schema, and SELECT on the table:

-- Snowflake SQL. From Snowflake's "Configuring access control" page
-- (COMMENT clause omitted); not run.
CREATE ROLE r1;

GRANT USAGE ON WAREHOUSE w1 TO ROLE r1;
GRANT USAGE ON DATABASE d1 TO ROLE r1;
GRANT USAGE ON SCHEMA d1.s1 TO ROLE r1;
GRANT SELECT ON TABLE d1.s1.t1 TO ROLE r1;

GRANT ROLE r1 TO USER smith;

A future grant, such as GRANT SELECT ON FUTURE TABLES IN SCHEMA d1.s1 TO ROLE r1, covers tables created later. Snowflake recommends granting custom roles to SYSADMIN, so administrators can manage the objects those roles own.

Loading data: stages and COPY INTO

A stage is a location in cloud storage that holds data files. An internal stage is inside your Snowflake account: every user and table has one, and CREATE STAGE makes named ones. An external stage points at files in Amazon S3, Google Cloud Storage, or Microsoft Azure.

Loading takes two steps. PUT uploads local files to an internal stage. It runs from a client such as the Snowflake CLI, not from a worksheet in Snowsight, the web interface. COPY INTO then loads the staged files into an existing table, using your warehouse. Bulk loading reads delimited files such as CSV, and JSON, Avro, ORC, Parquet, and XML.

  • Errors. The bulk-load default for ON_ERROR, ABORT_STATEMENT, stops the load when any error is found. CONTINUE and SKIP_FILE are the alternatives, and VALIDATION_MODE checks staged files without loading them.
  • Reruns. COPY INTO ignores staged files it has already loaded, unless you add FORCE = TRUE.
  • Continuous loading. Snowpipe loads files as they arrive in a stage, on serverless compute that Snowflake manages.

Loading raw data and transforming it inside the warehouse is the ELT pattern, explained in ETL vs ELT.

A first session

This is Snowflake's introductory tutorial, shortened. It uses the tutorial's sample CSV files and the warehouse created above. Creating a database makes it, and its PUBLIC schema, current for the session.

-- Snowflake SQL. From Snowflake's "Snowflake in 20 minutes" tutorial; not run.
CREATE OR REPLACE DATABASE sf_tuts;

CREATE OR REPLACE TABLE emp_basic (
   first_name STRING ,
   last_name STRING ,
   email STRING ,
   streetaddress STRING ,
   city STRING ,
   start_date DATE
   );

PUT file:///tmp/employees0*.csv @%emp_basic;

COPY INTO emp_basic
  FROM @%emp_basic
  FILE_FORMAT = (type = csv field_optionally_enclosed_by='"')
  PATTERN = '.*employees0[1-5].csv.gz'
  ON_ERROR = 'skip_file';

SELECT email FROM emp_basic WHERE email LIKE '%.uk';

DROP DATABASE IF EXISTS sf_tuts;
DROP WAREHOUSE IF EXISTS sf_tuts_wh;

@%emp_basic is the table's own stage. PUT compresses files with gzip by default, which is why the pattern ends in .gz. The last two statements clean up.

Micro-partitions and clustering

All table data is divided automatically into micro-partitions, units of storage that each hold 50 MB to 500 MB of uncompressed data, stored column by column. Snowflake records the range of values of each column in each micro-partition, so a filtered query can skip, or prune, micro-partitions that cannot hold matching rows. A filter that relies on a subquery does not prune.

Tables are partitioned in the order the data is loaded. For very large tables where that order does not match the filters, a clustering key (CLUSTER BY) tells Snowflake to keep rows with similar values in the same micro-partitions. Snowflake says clustering suits tables of multiple terabytes, and maintaining it consumes credits. For choosing a key, see partitioning strategies in Snowflake and BigQuery.

Time Travel and zero-copy cloning

Time Travel lets you query, clone, or restore data as it was before a change or a drop, within a retention period. The standard period is 1 day and is enabled automatically for all accounts. Enterprise Edition and higher can set up to 90 days on permanent tables, which adds storage charges. After the period ends, data moves into Fail-safe, where only Snowflake can recover it.

-- Snowflake SQL. From Snowflake's "Understanding & using Time Travel" page; not run.
SELECT * FROM my_table AT(OFFSET => -60*5);

CREATE TABLE restored_table CLONE my_table
  AT(TIMESTAMP => 'Wed, 26 Jun 2024 01:01:00 +0300'::timestamp_tz);

UNDROP TABLE mytable;

The first statement reads the table as of five minutes ago. Without the AT clause, CREATE ... CLONE copies a table, schema, or database as it is now. The clone is writable and independent of its source. It is called zero-copy because it shares the source's micro-partitions and adds no storage until its data changes. Most clones do not copy the grants on the source object.

Secure Data Sharing applies the same idea between accounts: no data is copied, and the consumer gets a read-only database and pays only for the compute to query it.

How dbt connects to Snowflake

dbt runs SQL transformations inside Snowflake, so it connects as a Snowflake user. dbt's Snowflake setup page lists what must exist first: an account, a user, a role, a warehouse, a database, and a schema. Sign-in can use a key pair, single sign-on, a password with multi-factor authentication, or workload identity federation.

# dbt profiles.yml for Snowflake. From the dbt documentation's Snowflake
# setup page (single sign-on example); not run.
default:
  target: dev
  outputs:
    dev:
      type: snowflake
      threads: 16
      authenticator: externalbrowser
      account: ABC123
      user: JANE.SMITH@YOURCOMPANY.COM
      database: JAFFLE_SHOP
      warehouse: TRANSFORM
      schema: JANE_SMITH

The role needs USAGE on the warehouse, database, and schema, SELECT on source tables, and CREATE TABLE and CREATE VIEW on the schema it builds in. By default, tables dbt creates are transient, meaning no Fail-safe and at most 1 day of Time Travel, and incremental models use the merge strategy. Next, follow the dbt tutorial for beginners or browse the dbt hub.

Frequently Asked Questions

What are the core components of Snowflake's architecture?

Three layers. Database storage holds table data in a compressed, columnar format. Compute is virtual warehouses, independent clusters that run SQL. Cloud services handles sign-in, access control, metadata, and query optimization.

What are the first steps to get started with Snowflake?

Create a virtual warehouse, a database, and a table, stage a file with PUT, load it with COPY INTO, and query it. Snowflake's "Snowflake in 20 minutes" tutorial covers these steps and says a 30-day trial account provides free credits.

How does Snowflake handle security and access control?

Through role-based access control: access is denied unless a grant to one of your roles allows it. Every edition also includes automatic encryption of all data, multi-factor authentication, and network policies that limit access by IP address.

How do you set up a data warehouse in Snowflake?

Create a database and schemas, a warehouse that suspends when idle, and roles with grants on both. Load raw data through a stage with COPY INTO, then build modeled tables and views on top.

Primary sources and further reading

Snowflake documentation, except the last item.

These pages were read on November 22, 2026. No statement in this article was run. Prices and product behavior change.