0
0
Snowflakecloud~5 mins

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

Choose your learning style9 modes available
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.