Creating a Snowflake account and workspace - Performance & Efficiency
Start learning this pattern below
Jump into concepts and practice - no test required
When setting up a Snowflake account and workspace, it's important to understand how the time to complete these steps changes as more resources or users are involved.
We want to know how the effort grows when creating accounts and workspaces for different sizes of teams or projects.
Analyze the time complexity of the following operation sequence.
-- Create a new Snowflake account
-- Note: CREATE ACCOUNT is typically done via Snowflake UI or partner, not via SQL
-- Create a workspace (database and schema)
CREATE DATABASE my_database;
CREATE SCHEMA my_database.my_schema;
-- Create users for the workspace
CREATE USER user1 PASSWORD='pass1';
CREATE USER user2 PASSWORD='pass2';
-- ... repeated for each user
This sequence sets up a workspace with a database and schema, and adds users.
Identify the API calls, resource provisioning, data transfers that repeat.
- Primary operation: Creating users with separate commands.
- How many times: Once per user added to the workspace.
As the number of users increases, the number of user creation commands grows directly with it.
| Input Size (n users) | Approx. API Calls/Operations |
|---|---|
| 10 | ~10 user creation calls + fixed workspace setup |
| 100 | ~100 user creation calls + fixed workspace setup |
| 1000 | ~1000 user creation calls + fixed workspace setup |
Pattern observation: The time grows linearly with the number of users added, while workspace creation remains constant.
Time Complexity: O(n)
This means the time to create the full setup grows in direct proportion to the number of users you add.
[X] Wrong: "Creating the account and workspace takes longer as more users are added."
[OK] Correct: The workspace setup happens once and takes about the same time regardless of user count; only user creation scales with the number of users.
Understanding how setup time grows with team size shows you can plan resources and time well, a useful skill when working with cloud infrastructure.
"What if we created users in batches instead of one by one? How would the time complexity change?"
Practice
Solution
Step 1: Understand Snowflake account creation
Before using Snowflake, you must have an account created by signing up on their website.Step 2: Recognize account as the starting point
Without an account, you cannot access Snowflake services or create warehouses and databases.Final Answer:
Sign up on the Snowflake website to create an account -> Option AQuick Check:
First step = Sign up [OK]
- Trying to create tables before having an account
- Assuming local software installation is needed
- Confusing account creation with cloud VM setup
Solution
Step 1: Recall Snowflake SQL syntax for warehouse creation
The correct command to create a warehouse isCREATE WAREHOUSEfollowed by the warehouse name.Step 2: Identify correct keyword usage
OnlyCREATEis valid;MAKE,NEW, andBUILDare not valid SQL commands in Snowflake.Final Answer:
CREATE WAREHOUSE my_warehouse; -> Option CQuick Check:
Use CREATE for new objects [OK]
- Using non-SQL keywords like MAKE or BUILD
- Omitting the CREATE keyword
- Incorrect command order
CREATE WAREHOUSE wh1; CREATE DATABASE db1; USE DATABASE db1; CREATE SCHEMA sc1;
What is the current active schema after these commands?
Solution
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.Step 2: Understand default schema behavior
When you use a database but do not set a schema, Snowflake defaults to thepublicschema inside that database.Final Answer:
db1.public -> Option DQuick Check:
Default schema = public if not set [OK]
- Assuming created schema is active automatically
- Confusing warehouse with schema
- Ignoring default schema behavior
CREATE WAREHOUSE mywh WITH WAREHOUSE_SIZE = 'LARGE';
But get an error. What is the likely cause?
Solution
Step 1: Check parameter syntax for warehouse creation
The correct syntax isCREATE WAREHOUSE mywh WAREHOUSE_SIZE = 'LARGE';-- parameters like WAREHOUSE_SIZE follow directly after the warehouse name, withoutWITH.Step 2: Identify the syntax error
UsingWITHcauses a syntax error because it is not part of the CREATE WAREHOUSE syntax.Final Answer:
The WITH keyword is not valid for specifying warehouse parameters -> Option BQuick Check:
No WITH for warehouse params [OK]
- Using the WITH keyword incorrectly
- Assuming case sensitivity causes error
- Forgetting semicolon (usually not fatal in Snowflake)
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?Solution
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.Step 2: Create schema and set it active
After creating the schema, useUSE SCHEMA sc_test;to make it the active schema for commands.Final Answer:
CREATE WAREHOUSE wh_test; CREATE DATABASE db_test; USE DATABASE db_test; CREATE SCHEMA sc_test; USE SCHEMA sc_test; -> Option AQuick Check:
Correct order and active schema set [OK]
- Creating schema before switching to database
- Not setting active schema after creation
- Wrong command order causing errors
