Course
BasicLearn how to use common PostgreSQL functions to process various types of data with ease. Soon, you'll be able to modify textual data, perform calculations, round numbers up or down, change date and time formats, and even adjust time zone info!
Welcome to Common PostgreSQL Functions! This is an interactive course for intermediate SQL users who know the basics of SQL. We assume that you can write a SELECT query and know how to use GROUP BY, HAVING, and ORDER BY clauses. Cool. But why stop learning now? You have so many possibilities!
If you're a complete beginner, don't worry. Just start with the SQL Basics in PostgreSQL course and come back here later.
After learning the basics of SQL, the next step to proficiency in SQL is to learn built-in functions that come with your database. A function is a predefined piece of code that performs a specific task. You likely know aggregate functions like COUNT()
, SUM()
, or AVG()
that compute simple statistics.
Database engines have many more built-in functions. Functions extend the functionality of basic SQL and allow you to perform frequently-used operations on data. This enables you to work more effectively, write more sophisticated SQL queries, and take full advantage of the opportunities offered by databases.
In this course, you will learn about functions in PostgreSQL (version 9 and up). PostgreSQL, also known as Postgres, is one of the most popular free and open-source database management systems.
As indicated by popularity rankings, PostgreSQL is still gaining more fans. Last year it gained more users than one of the market leaders—Microsoft SQL Server. Interest in Postgres is also reflected in the growing number of job offers for developers and analysts.
You will learn about:
CONCAT()
allows you to merge multiple texts into one.LENGTH()
finds the length of a text.LOWER()
, UPPER()
, and INITCAP()
put text into lowercase, UPPERCASE, or Init Caps.TRIM()
, LTRIM()
, and RTRIM()
remove unnecessary characters from the text.SUBSTRING()
finds parts of a text.REVERSE()
reverses the text.ROUND()
, TRUNC()
, and CEIL()
are functions that round numbers to a specific number of digits.ABS()
computes the absolute value of a number.DATE_TRUNC()
helps you group data by year, month, week, quarter, and other periods of time.DATE_PART()
extracts part of the date (year, month, day, hour, minute, etc.) from a date.COALESCE()
and NULLIF()
make working with NULL
s easier.GREATEST()
and LEAST()
find the maximum or minimum value within a number of expressions in one row.The course is interactive. You learn the functions through practice by writing real SQL queries. You solve the exercises directly in your web browser. Our platform runs your query and verifies your solution. So, you don't need to install any software on your computer.
Note: This course does not teach you how to write your own functions (user-defined functions) in PostgreSQL. If you want to create your own functions, we recommend our Writing User-Defined Functions in PostgreSQL course.
SELECT
, WHERE
, JOIN
, GROUP BY
, and ORDER BY
.NULL
with meaningful values in PostgreSQL.Plus, you'll get to practice your skills on over 143 interactive exercises.
Course progress
Exercises completed
1.
How much do you know about SQL?
2.
Find out how to manipulate texts in your database.
3.
Numbers can cause a headache. You need to fight them back!
4.
Learn how to work with date and time data in PostgreSQL
5.
Learn how to successfully work with NULLs.
6.
Find out how well you remember the contents of this course