Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close

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.

What's in It for Me?

  • 94 interactive exercises. Learn at your own pace, from anywhere and anytime. Interact with hands-on exercises for improved retention.
  • Lifetime access to the course. When you purchase the course, you'll get instant personal access to all of its content.
  • Certificate of completion. After you successfully finish all of the exercises, you'll get a downloadable PDF certificate to showcase your accomplishment.
  • 30-day money-back guarantee. If you're not satisfied with the quality of the course, you can get a refund within 30 days of your purchase.
  • Hints for the exercises. You can ask questions and share insights with other members of our community through the Discuss tab.

What Do You Need to Take This Course?

  • A web browser and an Internet connection.
  • Basic knowledge of SQL.
  • Basic knowledge of programming.

This Course Will Teach You:

  • What a user-defined function is and when you should use it.
  • How to create a user-defined function in PostgreSQL.
  • The syntax of PostgreSQL’s most commonly used procedural language, PL/pgSQL.
  • The different types of parameters in PostgreSQL functions (IN, OUT and INOUT).
  • How you can use results of a SQL query inside a function.
  • How you can nest function calls.
  • How to return a table from a function.

Who Should Take This Course?

  • Students taking course on relational databases.
  • PostgreSQL developers.
  • Beginner Database Administrators (DBAs).
  • People interested in programming relational databases, particularly PostgreSQL.
  • Bundle deals
  • Table of contents
  • Reviews
Start for free
Gift this course

Bundle deals

86%
off

Reg. price
$1442

One to Rule 'Em All

Includes 36 courses Python Basics. Part 1, Python Basics. Part 2, Python Basics. Part 3, Python Data Structures in Practice, Built-in Algorithms in Python, Working with Strings in Python, SQL Basics, SQL Practice Set, SQL JOINs, Standard SQL Functions, Creating Basic SQL Reports, Window Functions, Revenue Trend Analysis in SQL, How to INSERT, UPDATE, and DELETE Data in SQL, Recursive Queries, Creating Tables in SQL, Statistics 101, SQL Basics in MS SQL Server, How to Insert, Update, or Delete Data in MS SQL Server, Common Functions in MS SQL Server, Revenue Trend Analysis in SQL Server, Creating Basic SQL Reports in SQL Server, Window Functions in MS SQL Server, Recursive Queries in MS SQL Server, GROUP BY Extensions in MS SQL Server, Introduction to Python for Data Science, How to Read and Write CSV Files in Python, How to Read and Write JSON Files in Python, SQL Basics in PostgreSQL, PostgreSQL JOINs, SQL Practice Set in PostgreSQL, Window Functions in PostgreSQL, Recursive Queries in PostgreSQL, Writing User-Defined Functions in PostgreSQL, PostGIS, How to Read and Write Excel Files in Python

Bundle price $199

35 hours left at this price!

Buy bundle

63%
off

Reg. price
$324

PostgreSQL Complete Track

Includes 8 courses SQL Basics in PostgreSQL, PostgreSQL JOINs, SQL Practice Set in PostgreSQL, Window Functions in PostgreSQL, Creating Basic SQL Reports in PostgreSQL, Recursive Queries in PostgreSQL, Writing User-Defined Functions in PostgreSQL, PostGIS

Bundle price $119

35 hours left at this price!

Buy bundle

Table of contents

Progress: 0% completed 0 of 94 exercises done

1. Introduction to User-Defined Functions

Get familiar with creating functions in PostgreSQL.

More details Less
Start now

0% completed 0 of 11 exercises done

2. Writing Functions in PostgreSQL – the Basics

Get to know the basic syntax of implementing functions in PostgreSQL. Learn about parameter types supported in PostgreSQL functions.

More details Less
Start now

0% completed 0 of 29 exercises done

3. Writing Complex Functions in PostgreSQL

Learn how to use complex statements in functions.

More details Less
Start now

0% completed 0 of 18 exercises done

4. Functions returning tables in PostgreSQL

Discover how you can return tables from functions in PostgreSQL.

More details Less
Start now

0% completed 0 of 13 exercises done

5. Function management

Learn how to create, remove and rename functions in PostgreSQL.

More details Less
Start now

0% completed 0 of 8 exercises done

6. Quiz

Check your knowledge of writng functions in PostgreSQL by implementing a simple Extract-Tranform-Load (ETL) process.

More details Less
Start now

0% completed 0 of 15 exercises done

Reviews

Average rating

5/5100.0 (2)

Details

5 Stars 100%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
  • Tomasz Staszczak 2 years ago

    /100 ()

  • Adam Salach 3 years ago

    /100 ()

    I rate the course very well. It allowed me to systematize my knowledge on the subject of user-definied functions. The difficulty of the tasks increased with each successive stage, and that was OK.