Recall & Review
beginner
What is a stored procedure in Snowflake using Python?
A stored procedure is a set of SQL and Python commands saved in the database that can be run repeatedly to perform tasks like data processing or automation.
Click to reveal answer
beginner
How do you define a Python stored procedure in Snowflake?
You use the CREATE PROCEDURE statement with LANGUAGE PYTHON, then write your Python code inside a handler function that Snowflake runs when called.
Click to reveal answer
intermediate
What is the role of the 'handler' function in a Snowflake Python stored procedure?
The handler function contains the Python code that executes when the stored procedure is called. It receives context and parameters and returns results.
Click to reveal answer
intermediate
Why use stored procedures in Python on Snowflake instead of running scripts externally?
Stored procedures run close to the data inside Snowflake, reducing data transfer, improving speed, and allowing automation within the database environment.
Click to reveal answer
advanced
What permissions are needed to create and run Python stored procedures in Snowflake?
You need the CREATE PROCEDURE privilege on the schema and USAGE privilege on the database and schema. Also, EXECUTE privilege to run the procedure.
Click to reveal answer
Which keyword specifies that a stored procedure uses Python in Snowflake?
✗ Incorrect
In Snowflake, you specify LANGUAGE PYTHON to create a stored procedure using Python code.
What is the main function name Snowflake expects in a Python stored procedure?
✗ Incorrect
Snowflake expects a function named 'handler' as the entry point for Python stored procedures.
Which privilege is NOT required to create a Python stored procedure in Snowflake?
✗ Incorrect
DROP DATABASE privilege is unrelated to creating stored procedures.
Why is running Python code inside Snowflake stored procedures efficient?
✗ Incorrect
Running code inside Snowflake reduces data movement and speeds up processing.
How do you call a Python stored procedure in Snowflake after creation?
✗ Incorrect
The CALL statement is used to run stored procedures in Snowflake.
Explain how to create and use a Python stored procedure in Snowflake.
Think about the syntax, function name, and how you run it.
You got /4 concepts.
Describe the benefits of using Python stored procedures inside Snowflake compared to running Python scripts externally.
Consider where the code runs and how it affects performance.
You got /4 concepts.