Code notes & cookbook
Snowflake
Generic query
- • 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 and 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
Advanced data transformations
Date time query
- • 100 practical example of string to date in Snowflake
- • Current time and date in Snowflake
- • Current date in Snwoflake
Stored Procedure
- • How to write a SQL stored procedure in Snowflake
- • How to write a Python stored procedure in directly Snowflake (using Snowpark)
- • How to create and call a stored procedure in SQL
- • How to create and call a stored procedure in SQL (with input parameters)
Functions
- • How to create and use a SQL function in Snowflake
- • How to create and use a SQL table function in Snowflake