Setup Environment in Snowflake Cloud Datawarehouse

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:

CREATE DATABASE SALES_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_DB;
    USE SCHEMA Sales_Data;

Finding the context:

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


Next Section: Snowflake Overview



MetricCamp.com