Take your PostgreSQL skills to the next level by learning how to write your own functions.
Why write your own functions? In PostgreSQL, functions allow you to perform operations that would normally take several queries and round trips. In simple words, this means you'll get your results much faster. User-defined functions extend the functionality of PostgreSQL and add convenience, improve query logic, and allow other applications to reuse your database.
In this course, you'll learn about PL/pgSQL, the most commonly used procedural language in PostgreSQL. You'll get to know the syntax of PL/pgSQL, various types of parameters that functions in PostgreSQL support (IN, OUT, INOUT parameters), and how to use complex statements in a function body. Moreover, you'll learn to write functions with hands-on, practical examples based on real-world use cases. In the final part of the course, you'll write functions implementing a simple ETL (Extract-Transform-Load) process in a data warehouse (DWH).
Writing user-defined functions is something all advanced users of databases should know. This course is ideal for aspiring database programmers and future database administrators (DBAs).
Note: Up until PostgreSQL 11, user-defined functions in PostgreSQL were sometimes also called (and used as) stored procedures. Don't be surprised if you see the term "stored procedure" refer to a user-defined function in Postgres. This course only covers creating user-defined functions in PostgreSQL.
Get familiar with creating functions in PostgreSQL.
Get to know the basic syntax of implementing functions in PostgreSQL. Learn about parameter types supported in PostgreSQL functions.
Syntax of PL/pgSQL
Learn how to use complex statements in functions.
Side-effects in functions
Discover how you can return tables from functions in PostgreSQL.
Returning tables and sets
Learn how to create, remove and rename functions in PostgreSQL.
Check your knowledge of writng functions in PostgreSQL by implementing a simple Extract-Tranform-Load (ETL) process.