05 January 2019 ยท n-pacha ยท       Add to Favorites   Report

Setup the environment in Snowflake


We will create the virtual warehouse, database, and the schema. The SQL commands used in the lesson are given below. Just click on the code snippet once to copy to clipboard.

Creating a Virtual Warehouse:

CREATE WAREHOUSE TRAINING_WH
WITH
WAREHOUSE_SIZE = XSMALL
AUTO_SUSPEND = 60
AUTO_RESUME = TRUE
INITIALLY_SUSPENDED = TRUE
STATEMENT_QUEUED_TIMEOUT_IN_SECONDS = 300
STATEMENT_TIMEOUT_IN_SECONDS = 600;

Creating a Database (Remember to substitute your username):

CREATE DATABASE SALES_{USERNAME}_DB
DATA_RETENTION_TIME_IN_DAYS = 0
COMMENT = 'Ecommerce sales info';

Creating multiple Schemas:

create schema Sales_Data;
create schema Sales_Views;
create schema Sales_Stage;

Setting Context:

USE WAREHOUSE TRAINING_WH;
USE DATABASE SALES_{USERNAME}_DB;
USE SCHEMA Sales_Data;

Finding the context:

select CURRENT_DATABASE(), CURRENT_SCHEMA(), CURRENT_WAREHOUSE();

๐Ÿ“™ Course Index
โ—€ Prev: Tour the snowflake user interface
โ–ถ Next:

n-pacha

posted on 05 January 2019

Read great educational content like this and a lot more !

Members get free exclusive access to content, new courses, and discounts. Signup for a free account to write a post / comment / upvote posts. Creating an account takes less than 5 seconds and you can start earning badges & points too

Copied