
Explore Snowflake scripting to write stored procedures using SQL and other languages. Master variables, literals, execute immediate, flow control, debugging, cursors, transactions, UDFs, and SCD type one and two implementations.
Learn how to view and download course material, including PPT, query files, Excel sheets, and images, from the resources tab in each section.
Understand stored procedures as a set of statements executed in order to run multiple SQL commands, with dynamic parameters, conditional logic, and loops, in Snowflake scripting.
Learn how to create databases and schemas and define sample stored procedures in Snowflake scripting, including parameters, returns, and calling procedures. See square root examples for basic execution.
Learn how to declare and assign variables in snowflake scripting, using declaration and body sections, defaults, lit, and binding with colon or dollar for session variables, testing with execute immediate.
Demonstrate variables in Snowflake scripting via declare and assign, use execute immediate, and derive full names by concatenating first, middle, and last names; explore session variable scope and simple arithmetic.
Explore table literals and identifiers in Snowflake scripting, using table of with scalar arguments for dynamic table names in the from clause, and identifiers for referencing any database objects.
Demonstrates writing snowflake scripting stored procedures with table literals and identifiers, using session variables and a parameter to count rows in employees, departments, countries, and locations.
Explore flow control in snowflake scripting by mastering branching constructs, including if-else and case statements, with syntax rules, conditions, and how true conditions guide the execution flow.
Practice if and case statements in Snowflake scripting by building small examples that determine even or odd numbers and compute taxes via slabs using session variables and execute immediate.
Master looping in snowflake scripting with for loops (counter and cursor based), while, repeat, and loop, using break and syntax to repeat blocks and process rows in a cursor.
Master for and while loops in snowflake scripting with practical examples: print a star triangle and identify primes up to n; return results as a stored procedure table.
Cursors enable row-by-row processing of rows from tables or views by declaring, opening, fetching, and closing a cursor, with dynamic runtime parameters and bind variables.
Learn how to group statements into transactions in Snowflake using begin transaction, commit, and rollback; understand autocommit, scope, and how DDL inside a transaction is treated.
Explore how Snowflake scripting uses stored procedures to manage transactions with begin transaction, commit, and rollback, and how exception handling prevents partial commits.
Explore generic procedures in Snowflake scripting to automate data loads, implement SCD type 1 and 2, automate 1-to-1 view creation, and migrate DDL across databases.
Create a single Snowflake stored procedure to automate loading multiple file types from any cloud, using a control table, a temporary stage, and a single copy command.
Hi, in this Snowflake Scripting course I have explained
1. The concepts of Snowflake Scripting.
2. Writing Stored Procedures.
3. Writing User Defined Functions(UDFs).
4. Generic Stored Procedures that can be used in Snowflake Projects.
This course will help you..
1. If you are struggling to understand complex stored procedures written by others.
2. If you want to write simple to complex stored procedures and User Defined Functions.
3. If you want to go through some procedures that can be implemented in your projects with small changes.
Below are the concepts I have explained in this course.
What is a stored procedure and blocks in a procedure
Variables
Table Literals
Identifiers
Flow Control Statements - Branching or Conditional(If Else and Case)
Flow Control Statements - Looping(For and While)
Cursors
Resultsets
Exception Handling
Transactions
Snowflake Information Schema
Below are the generic procedures and implementations explained.
1. Procedure for Automated Data Loads
2. SCD Type-1 implementation
3. SCD Type-2 implementation
4. Procedure for 1 to 1 View creation
5. Procedure for dropping all tables from a schema
6. Procedure for dropping all views from a schema
7. Procedure for migrating table DDL from one database to other database
8. Procedure for migrating views from one database to other database
9. Procedure for Automating Full load from staging to target tables
10. Procedure for Automating Delta/Incremental load from staging to target tables
11. Procedure for sample data setup for testing in lower environment
12. Code deployment using GitHub and Schema change