Tag Archives: Snowflake for Beginners

Snowflake for Beginners – Get Rows Meetings Multiple Conditions

Get Rows Meetings Multiple Conditions Create Table Of Superheroes – Create a table called SUPERHEROES. CREATE OR REPLACE TABLE SUPERHEROES ( – Column called ID allowing up to five characters “ID” VARCHAR (5), – Column called NAME allowing up to 100 characters “NAME” VARCHAR(100), – Column called ALTER_EGO allowing up to 100 characters “ALTER_EGO” VARCHAR(100), …

Snowflake for Beginners – Give Column An Alias

Give Column An Alias Create Table Of Superheroes – Create a table called SUPERHEROES. CREATE OR REPLACE TABLE SUPERHEROES ( – Column called ID allowing up to five characters “ID” VARCHAR (5), – Column called NAME allowing up to 100 characters “NAME” VARCHAR(100), – Column called ALTER_EGO allowing up to 100 characters “ALTER_EGO” VARCHAR(100), – …

Snowflake for Beginners – Give Table An Alias

Give Table An Alias Create Table Of Superheroes – Create a table called SUPERHEROES. CREATE OR REPLACE TABLE SUPERHEROES ( – Column called ID allowing up to five characters “ID” VARCHAR (5), – Column called NAME allowing up to 100 characters “NAME” VARCHAR(100), – Column called ALTER_EGO allowing up to 100 characters “ALTER_EGO” VARCHAR(100), – …

Snowflake for Beginners – Left Join

Left Join Create Table Of Superheroes – Create a table called SUPERHEROES. If it already exists, replace it. CREATE OR REPLACE TABLE SUPERHEROES ( – Column called ID allowing up to five characters “ID” VARCHAR(5), – Column called NAME allowing up to 100 characters “NAME” VARCHAR(100), – Column called ALTER_EGO allowing up to 100 characters …

Snowflake for Beginners – Query A Table

Query A Table Create A Table For Superheroes – Create a table called SUPERHEROES. CREATE OR REPLACE TABLE SUPERHEROES ( – Column called ID allowing up to five characters “ID” VARCHAR (5), – Column called NAME allowing up to 100 characters “NAME” VARCHAR(100), – Column called ALTER_EGO allowing up to 100 characters “ALTER_EGO” VARCHAR(100), – …

Snowflake for Beginners – Return First Few Rows

Return First Few Rows Create Table Of Superheroes – Create a table called SUPERHEROES. CREATE OR REPLACE TABLE SUPERHEROES ( – Column called ALTER_EGO allowing up to 100 characters “ALTER_EGO” VARCHAR(100), – Column called BANK_BALANCE allowing 38 digits with 2 after the decimal point “AGE” INT, – Column called STATE allowing up to 100 characters …

Snowflake for Beginners – Return N Rows After Skipping First K Rows

Return N Rows After Skipping First K Rows Create Table Of Superheroes – Create a table called SUPERHEROES. CREATE OR REPLACE TABLE SUPERHEROES ( – Column called ALTER_EGO allowing up to 100 characters “ALTER_EGO” VARCHAR(100), – Column called BANK_BALANCE allowing 38 digits with 2 after the decimal point “AGE” INT, – Column called STATE allowing …

Snowflake for Beginners – Sample Random Rows From A Table

Sample Random Rows From A Table Create Table Of Superheroes – Create a table called SUPERHEROES. CREATE OR REPLACE TABLE SUPERHEROES ( – Column called ALTER_EGO allowing up to 100 characters “ALTER_EGO” VARCHAR(100), – Column called BANK_BALANCE allowing 38 digits with 2 after the decimal point “AGE” NUMBER(3, 0) ); Insert Rows For Each Superhero …

Snowflake for Beginners – Convert Columns Into Rows

Convert Columns Into Rows UNPIVOT converts a table’s columns into rows. Create Table Of Superheroes – Create a table called SUPERHEROES. CREATE OR REPLACE TABLE SUPERHEROES ( “ALTER_EGO” VARCHAR(100), “AGE” INT, “2015” INT, “2016” INT, “2017” INT, “2018” INT, “2019” INT ); Insert Rows For Each Superhero – Insert rows into SUPERHEROES INSERT INTO SUPERHEROES VALUES …