Welcome to our course on user-defined functions in PosrgreSQL! This course will teach you the basics of creating functions in PostgreSQL.
Note that we use the term "function". In PostgreSQL 11, a new notion of stored procedures was introduced. This course only covers creating user-defined functions in PostgreSQL. Up till PostgreSQL 11, people often called (and used) user-defined functions as stored procedures. Don't be surprised if you see the term "stored procedure" refer to a user-defined function in Postgres.
In this part of our course, we'll introduce you to the concept of user-defined functions and describe the main benefits of using them. We'll also introduce and briefly explain the syntax of functions. Finally, and most importantly, we'll show you some practical examples of using functions.
But first and foremost, let's review the database tables we are going to use. The first table is named