Bird
Raised Fist0
Snowflakecloud~5 mins

Creating a Snowflake account and workspace - Step-by-Step CLI Walkthrough

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Introduction
Creating a Snowflake account and workspace lets you start using Snowflake's cloud data platform. It solves the problem of needing a secure, scalable place to store and analyze your data without managing hardware.
When you want to start a new project that needs cloud data storage and analysis.
When your team needs a shared workspace to collaborate on data queries and reports.
When you want to try Snowflake's features with a free trial account.
When you need to separate environments for development and production data.
When you want to manage users and roles securely in a cloud data platform.
Commands
This command connects you to your Snowflake account using SnowSQL CLI with your account identifier and username.
Terminal
snowsql -a xy12345.us-east-1 -u admin_user
Expected OutputExpected
Welcome to SnowSQL! You are now connected to the Snowflake account xy12345.us-east-1 as user admin_user.
-a - Specifies the Snowflake account identifier.
-u - Specifies the username to log in.
This SQL command creates a new virtual warehouse named 'my_warehouse' which is the compute resource for running queries.
Terminal
CREATE WAREHOUSE my_warehouse WITH WAREHOUSE_SIZE = 'SMALL' WAREHOUSE_TYPE = 'STANDARD' AUTO_SUSPEND = 300 AUTO_RESUME = TRUE;
Expected OutputExpected
Statement executed successfully.
This command creates a new database called 'my_database' to organize your data.
Terminal
CREATE DATABASE my_database;
Expected OutputExpected
Statement executed successfully.
This command sets the current warehouse to 'my_warehouse' so queries use this compute resource.
Terminal
USE WAREHOUSE my_warehouse;
Expected OutputExpected
Using warehouse MY_WAREHOUSE.
This command lists all warehouses in your account to verify your warehouse was created.
Terminal
SHOW WAREHOUSES;
Expected OutputExpected
name | state | size | type | auto_suspend | auto_resume MY_WAREHOUSE | SUSPENDED | SMALL | STANDARD | 300 | TRUE
Key Concept

If you remember nothing else, remember: a Snowflake account holds your data and compute resources, and you must create and select a warehouse to run queries.

Common Mistakes
Trying to run queries without selecting a warehouse first.
Snowflake needs a warehouse to process queries; without selecting one, queries will fail.
Always run 'USE WAREHOUSE your_warehouse_name;' before running queries.
Using incorrect account identifier format when connecting with SnowSQL.
The account identifier must include region and cloud platform info; otherwise, connection fails.
Use the full account identifier like 'xy12345.us-east-1' when connecting.
Summary
Connect to your Snowflake account using SnowSQL with the correct account identifier and username.
Create a warehouse to provide compute resources for running queries.
Create a database to organize your data.
Select the warehouse before running queries to ensure they execute properly.
Verify your warehouse creation by listing all warehouses.

Practice

(1/5)
1. What is the first step to start using Snowflake for data storage and analysis?
easy
A. Sign up on the Snowflake website to create an account
B. Write SQL queries to create tables
C. Install Snowflake software on your computer
D. Create a virtual machine in the cloud

Solution

  1. Step 1: Understand Snowflake account creation

    Before using Snowflake, you must have an account created by signing up on their website.
  2. Step 2: Recognize account as the starting point

    Without an account, you cannot access Snowflake services or create warehouses and databases.
  3. Final Answer:

    Sign up on the Snowflake website to create an account -> Option A
  4. Quick Check:

    First step = Sign up [OK]
Hint: Always start by creating your Snowflake account online [OK]
Common Mistakes:
  • Trying to create tables before having an account
  • Assuming local software installation is needed
  • Confusing account creation with cloud VM setup
2. Which SQL command is used inside Snowflake to create a new warehouse?
easy
A. NEW WAREHOUSE my_warehouse;
B. MAKE WAREHOUSE my_warehouse;
C. CREATE WAREHOUSE my_warehouse;
D. BUILD WAREHOUSE my_warehouse;

Solution

  1. Step 1: Recall Snowflake SQL syntax for warehouse creation

    The correct command to create a warehouse is CREATE WAREHOUSE followed by the warehouse name.
  2. Step 2: Identify correct keyword usage

    Only CREATE is valid; MAKE, NEW, and BUILD are not valid SQL commands in Snowflake.
  3. Final Answer:

    CREATE WAREHOUSE my_warehouse; -> Option C
  4. Quick Check:

    Use CREATE for new objects [OK]
Hint: Use CREATE keyword to make new Snowflake objects [OK]
Common Mistakes:
  • Using non-SQL keywords like MAKE or BUILD
  • Omitting the CREATE keyword
  • Incorrect command order
3. Given the SQL commands run inside Snowflake:
CREATE WAREHOUSE wh1;
CREATE DATABASE db1;
USE DATABASE db1;
CREATE SCHEMA sc1;

What is the current active schema after these commands?
medium
A. sc1
B. wh1
C. db1.sc1
D. db1.public

Solution

  1. Step 1: Analyze commands executed

    The commands create a warehouse, a database, switch to that database, and create a schema inside it. However, no command sets the active schema explicitly.
  2. Step 2: Understand default schema behavior

    When you use a database but do not set a schema, Snowflake defaults to the public schema inside that database.
  3. Final Answer:

    db1.public -> Option D
  4. Quick Check:

    Default schema = public if not set [OK]
Hint: Without USE SCHEMA, default is database.public [OK]
Common Mistakes:
  • Assuming created schema is active automatically
  • Confusing warehouse with schema
  • Ignoring default schema behavior
4. You run this command in Snowflake:
CREATE WAREHOUSE mywh WITH WAREHOUSE_SIZE = 'LARGE';

But get an error. What is the likely cause?
medium
A. Warehouse size must be lowercase like 'large'
B. The WITH keyword is not valid for specifying warehouse parameters
C. Missing semicolon at the end
D. Warehouse name 'mywh' is reserved

Solution

  1. Step 1: Check parameter syntax for warehouse creation

    The correct syntax is CREATE WAREHOUSE mywh WAREHOUSE_SIZE = 'LARGE'; -- parameters like WAREHOUSE_SIZE follow directly after the warehouse name, without WITH.
  2. Step 2: Identify the syntax error

    Using WITH causes a syntax error because it is not part of the CREATE WAREHOUSE syntax.
  3. Final Answer:

    The WITH keyword is not valid for specifying warehouse parameters -> Option B
  4. Quick Check:

    No WITH for warehouse params [OK]
Hint: Warehouse parameters listed directly after name, no WITH [OK]
Common Mistakes:
  • Using the WITH keyword incorrectly
  • Assuming case sensitivity causes error
  • Forgetting semicolon (usually not fatal in Snowflake)
5. You want to create a Snowflake workspace with a warehouse named wh_test, a database db_test, and a schema sc_test. Which sequence of commands correctly sets up the workspace and makes sc_test the active schema?
hard
A. CREATE WAREHOUSE wh_test; CREATE DATABASE db_test; USE DATABASE db_test; CREATE SCHEMA sc_test; USE SCHEMA sc_test;
B. CREATE DATABASE db_test; CREATE WAREHOUSE wh_test; CREATE SCHEMA sc_test; USE SCHEMA sc_test;
C. CREATE WAREHOUSE wh_test; CREATE SCHEMA sc_test; CREATE DATABASE db_test; USE SCHEMA sc_test;
D. CREATE WAREHOUSE wh_test; CREATE DATABASE db_test; CREATE SCHEMA sc_test; USE DATABASE db_test;

Solution

  1. Step 1: Create warehouse and database in correct order

    First create the warehouse, then the database. Then switch to the database to create schema inside it.
  2. Step 2: Create schema and set it active

    After creating the schema, use USE SCHEMA sc_test; to make it the active schema for commands.
  3. Final Answer:

    CREATE WAREHOUSE wh_test; CREATE DATABASE db_test; USE DATABASE db_test; CREATE SCHEMA sc_test; USE SCHEMA sc_test; -> Option A
  4. Quick Check:

    Correct order and active schema set [OK]
Hint: Always USE DATABASE before creating schema, then USE SCHEMA [OK]
Common Mistakes:
  • Creating schema before switching to database
  • Not setting active schema after creation
  • Wrong command order causing errors