All topics
Data warehouse / 46 guides
Snowflake
SQL patterns, warehouses, stored procedures and account usage queries.

Everyday queries
- How to DELETE with JOIN in Snowflake
- How to remove duplicates from a table in Snowflake
- Drop table in Snowflake if exists
- How to rename a column in Snowflake
- How to UPDATE a table with JOIN in Snowflake
- How to describe a table structure in Snowflake
- Query warehouse, database and schema
- How to perform an INSERT/UPDATE on match/unmatch in Snowflake
- How to find the credit usage of the last 7 days
- How to find the list of warehouses and the credit consumption in the last 7 days
- How to find the average daily space used for storage in the last 7 days
- How to find running queries and kill them
- How to find the most expensive query executed
- How to change the output format of DateTime in a session
- Add a column to an existing table
- How to create a Javascript function and call it in Snowflake
- How to suspend a warehouse in Snowflake
- How to resume a warehouse in Snowflake
- How you can resize a warehouse in Snowflake
- How to create a warehouse in Snowflake (initially suspended)
- How to use a warehouse in Snowflake
- How to drop a warehouse in Snowflake
- How to get information and the results of the last executed query
Pivot and unpivot
Dates and times
Stored procedures
Functions
Period-to-date
- How to calculate YTD, QTD and MTD in Snowflake
- How to calculate week to date (WTD) in Snowflake
- How to compare YTD with the same period last year in Snowflake
- How to calculate YTD growth % vs prior year in Snowflake
- How to handle 29 February when comparing with last year in Snowflake
- How to compare an incomplete month with the same days of last month in Snowflake
- How to compare with the same weekday last year in Snowflake (364 days)
- How to calculate a rolling 12-month total in Snowflake
- How to calculate a rolling 3-month average in Snowflake
- How to calculate a running total that resets every year in Snowflake
- How to calculate fiscal year to date in Snowflake (fiscal year starting in April)
- How to fill missing days before a running total in Snowflake (date spine)