Creating Basic SQL Reports in PostgreSQL

Gain competitive skills in SQL by learning how to create SQL reports in the PostgreSQL database! This online course consists of 97 interactive exercises; after you complete them all, you'll be able to track and analyze the performance of your metrics. The skills you acquire here can be applied to any industry.

Table of contents

10 free interactive coding challenges

Lifetime access


limited to this course only


Buy now

Want a better deal?


Get unlimited lifetime access to all 69 present and future courses

Save $450

Unlimited lifetime access


to all 69 present and future courses



75% OFF

Buy now

Interactive exercises

10 h

Estimated time


Users enrolled


152 ratings

This online course will be of interest to analysts, junior programmers, software developers, and more. It is perfect for people who have basic knowledge of writing SQL queries in PostgreSQL and would like to analyze their work using meaningful reports. Scroll down for details!

Nowadays, data is collected everywhere and on everything. Knowing how to understand and interpret data you've collected lets you make more informed decisions in business (but not limited to business). In this online course, you'll learn how to make use of your SQL toolkit to build insightful SQL reports from scratch. Furthermore, because of that, you will be able to control the key indicators and metrics of your data. These skills benefit anyone who wants to be successful in data analysis, from sales to accounting to dog walking to personal finance.

Cover image for the course 'Creating Basic SQL Reports in PostgreSQL'

Imagine you're working in the sales department of a large e-commerce company, and you recently reported a significant sales drop. To better understand what happened, you have decided to find out more about your customers' journeys and what step they decide to leave your website. How can you accomplish this task? How would you spot any trends? Certainly, you could ask the IT department to verify this information, but they are usually very busy and creating such a report could take them days. However, with the knowledge provided in our online course, you can create SQL reports by yourself on the fly!

In this online course, you will learn how to build SQL reports from scratch using PostgreSQL GROUP BY and aggregate functions. You will gain the knowledge to manage long queries, include multiple metrics in one SQL query, and operate on the PostgreSQL database using several tables.

As a warmup, you'll refresh your skills by writing basic queries with a short quiz we have prepared. You will also get to know the database model we'll be working on through the course. Next, you'll use popular aggregate PostgreSQL functions to count business objects based on your criteria or calculate total amounts based on many objects.

Each online course part ends with a summary quiz which you can use to track how much you've learned so far and what you still need to focus on.

The next step for successful data analysis is data classification with CASE WHEN and GROUP BY. In this online course, you will learn what the most common beginner mistakes are and how to avoid them.

At the end of each part, you'll be challenged with a short summary quiz.

Last but not least, you'll teach yourself how to compare different business groups in just one SQL report. You'll find out how to do it in three ways and learn why it's good to know them all.

Click "Start for free" to learn more!

What's in It for Me?

  • 97 interactive exercises. Work on hands-on exercises for improved retention.
  • Lifetime access to the course. When you purchase the course, you'll gain instant personal access to all of its content.
  • Online certification. Complete all of the exercises successfully, and you'll be awarded with a certificate. You can publish the certificate on your LinkedIn profile (here's how.)
  • 30-day money-back guarantee. If you're not satisfied with the course quality, you can get a refund within 30 days of your purchase.
  • Hints for the exercises. You can make use of ready-made hints for exercises, or ask questions and share insights with other members of our community through the Discuss tab.

What Are the Requirements?

  • A web browser.
  • An Internet connection.
  • Understanding of basic PostgreSQL concepts that we present in our SQL Basics in PostgreSQL online course.

Learn How To:

  • Classify data: How to create custom classifications of objects in PostgreSQL using the CASE WHEN syntax and how you can use classifications to group objects in the GROUP BY clause.
  • Use popular PostgreSQL aggregate functions such as COUNT() or SUM() to summarize data in PostgreSQL.
  • Calculate average values, maximum averages, and minimum averages.
  • Manage long queries in a clear way.
  • Insert multiple metrics in SQL reports.
  • Calculate ratios and percentages.
  • Compare global and granular metrics.
  • Compare different business groups in a single report picking one of three methods presented in the course.
  • Use common table expressions (CTEs).

Who Should Take This Course?

  • Analysts working with PostgreSQL (and PostgreSQL aggregate functions in particular.)
  • Beginner data science enthusiasts, particularly those interested in SQL reports.
  • Students taking a class or online course related to relational databases.
  • Anyone interested in SQL reports or a career in reporting.

Table of contents


Paid content


Course progress


Exercises completed



Get to know the data model and review some basic SQL concepts.



Get to know the database



Summarizing Data in SQL

Learn how to create simple yet useful business metrics.



Providing detailed information and counting objects

Calculating metrics for multiple business objects

Understanding the difference between various count metrics



Classifying Data with CASE WHEN and GROUP BY

Discover how to get metrics based on custom classifications.



Custom classifications of business objects

Custom grouping of business objects

Custom counting of business objects



Multi-level Aggregation

Learn how to construct reports that aggregate data on multiple levels.



Basic multi-level aggregation

Multi-level aggregation in groups

Multi-level aggregation with custom classification

Three or more aggregation levels



Multiple Metrics in One Report

Discover how to include multiple metrics in a single report.



Multiple metrics for a single object

Metrics for two groups

Ratios and percentages

Global vs. specific metrics



Comparing Groups in One Report

Find out even more about how you can compare groups in single SQL reports.



Method One

Method Two

Method Three


Reviews (41)

Average rating



152 ratings


5 stars


4 stars


3 stars


2 stars


1 stars