Exercise 2.1 โ Free-Tier Setup + First Warehouse + Cost Guardrails
30 minutes end-to-end. At the end you'll have a working Snowflake trial account, a properly sized warehouse, a database, a role, and enough cost protection that you could leave the tab open for a month without damage. Required before any other Snowflake lesson.
Cost: $0. Snowflake gives you $400 in credits, 30 days, no credit card. You will burn about $0.05โ$0.20 doing this exercise. Your whole Snowflake module will consume <$10 of credits if you follow the guardrails.
Step 1 โ Sign up
-
Go to signup.snowflake.com.
Use your personal email. Work email is fine too, but personal is more portable for continued practice after the contract. -
Pick: Enterprise edition (to get 90-day Time Travel later), AWS cloud, US West (Oregon) region (or whichever is closest to you โ reduces latency on every lab).
Edition can't be changed after signup. Enterprise is the JD-relevant tier. Standard works too but Time Travel is capped at 1 day. - Confirm via email. You'll land in Snowsight (Snowflake's web UI). Bookmark the URL โ it's account-unique.
Step 2 โ Tour Snowsight for 5 minutes
Left nav:
- Worksheets โ where you write SQL. Your SSMS / DBeaver / psql equivalent.
- Dashboards โ charts from queries.
- Data โ Databases โ schema browser.
- Admin โ Warehouses โ where you see compute.
- Admin โ Users & Roles โ RBAC.
- Admin โ Cost Management โ bookmark this. It's the only place that shows your credit burn.
- Marketplace โ free datasets to practice on. We'll use one later.
Step 3 โ Run your first SQL
Open a new worksheet. Make sure the role selector (top right of the worksheet) is ACCOUNTADMIN โ it will be by default.
Paste this and run (Cmd/Ctrl+Enter, or click the play button):
SELECT CURRENT_ACCOUNT(), CURRENT_REGION(), CURRENT_USER(), CURRENT_ROLE();
You should see one row back. Congratulations โ you are now billing compute. (Very little, but technically.)
Step 4 โ Create a learning warehouse with guardrails
Replace the worksheet contents with this and run it:
-- Cost-protected learning warehouse.
-- Runs only when queries come in. Stops within 60s of idle.
CREATE WAREHOUSE IF NOT EXISTS LEARN_WH
WITH
WAREHOUSE_SIZE = 'XSMALL'
AUTO_SUSPEND = 60
AUTO_RESUME = TRUE
INITIALLY_SUSPENDED = TRUE
MIN_CLUSTER_COUNT = 1
MAX_CLUSTER_COUNT = 1
SCALING_POLICY = 'STANDARD'
COMMENT = 'learning, $400 trial, auto-suspend 60s';
USE WAREHOUSE LEARN_WH;
Verify in Admin โ Warehouses that it exists and is Suspended. That's correct โ it starts when you query.
Don't use COMPUTE_WH for lessons. It's the default with AUTO_SUSPEND of 10 minutes. That's 10ร what you want for learning. Always route learning queries to LEARN_WH.
Step 5 โ Create a learning database + schema
CREATE DATABASE IF NOT EXISTS LEARN_DB;
CREATE SCHEMA IF NOT EXISTS LEARN_DB.UTILITY;
USE DATABASE LEARN_DB;
USE SCHEMA UTILITY;
Step 6 โ Create some utility-domain sample data
We'll use this across the module. It's a toy meter-reads table loaded with synthetic data generated by Snowflake itself โ no external file needed.
CREATE OR REPLACE TABLE meter_reads (
meter_id STRING,
premise_zip STRING,
read_ts TIMESTAMP_NTZ,
consumption_kwh NUMBER(10,3),
quality_flag STRING
);
-- Generate 1M synthetic meter reads across 1000 meters, last 30 days.
INSERT INTO meter_reads
SELECT
'MTR-' || LPAD(UNIFORM(1, 1000, RANDOM()), 5, '0') AS meter_id,
TO_CHAR(97000 + UNIFORM(1, 299, RANDOM())) AS premise_zip,
DATEADD(minute, -UNIFORM(0, 60*24*30, RANDOM()), CURRENT_TIMESTAMP()) AS read_ts,
ROUND(UNIFORM(0, 5000, RANDOM()) / 1000.0, 3) AS consumption_kwh,
CASE WHEN UNIFORM(1, 100, RANDOM()) < 5 THEN 'E' ELSE 'G' END AS quality_flag
FROM TABLE(GENERATOR(rowcount => 1000000));
Run SELECT COUNT(*) FROM meter_reads; โ should say 1,000,000.
Step 7 โ Set your cost guardrails
Go to Admin โ Cost Management โ Resource Monitors โ + Resource Monitor. Create one called LEARNING_GUARD:
- Credit quota: 20 credits (~$40 โ plenty for the whole course)
- Frequency: Monthly or Never resets (your call)
- Assign to warehouse: LEARN_WH
- Actions: Notify at 75%, Suspend at 100%, Suspend Immediately at 110%
This is your seat belt. If you ever run an accidental catastrophic query, Snowflake will shut the warehouse down before you lose the $400 trial.
Step 8 โ Verify everything
Run this audit query โ it should return sensible results:
SELECT
CURRENT_WAREHOUSE() AS current_wh,
CURRENT_DATABASE() AS current_db,
CURRENT_SCHEMA() AS current_schema,
(SELECT COUNT(*) FROM meter_reads) AS reads_loaded,
(SELECT COUNT(DISTINCT meter_id) FROM meter_reads) AS unique_meters;
Expected: LEARN_WH, LEARN_DB, UTILITY, 1000000, ~1000.
Step 9 โ Save what matters to your notepad
Pop open the ๐ notepad (bottom-right FAB) and save these. Future you will thank you.
- Your Snowflake account URL (yourname-xy12345.snowflakecomputing.com)
- The date your trial expires (30 days from signup)
- The LEARN_WH, LEARN_DB, UTILITY names โ you'll reuse them every lesson
Checkpoint
- Signed up for Snowflake Enterprise trial, US West (Oregon), AWS
- Created LEARN_WH with AUTO_SUSPEND=60
- Created LEARN_DB.UTILITY schema
- Loaded 1M synthetic meter reads
- Set a 20-credit resource monitor
- Saved account URL & trial expiry to notepad