Learn PostgreSQL and SQL Quickly and Free

by David Stokes

Learn PostgreSQL and SQL Quickly and Free

Want to learn PostgreSQL? What if you could learn PostgreSQL without having to install the database, load data, find sample data, and it was free? PGExamples.com is what you are looking for.

First, let me state that I have no connection to the website or its author. I discovered PgExercises.com by accident and was impressed by its quality and completeness. I am so impressed that I am exploring a video series on it.

Learn SQL. Learn PostgreSQL.

PGexercises.com is based on increasingly complex exercises based on a provided dataset. As you progress, the questions get trickier. You do not have to download and load the available data into a server to do the exercises.

There are seven groups of exercises - Basic, Joins and Subqueries, Modifying Data, Aggregates, Date, String, and Recursive. The author recommends Learning SQL by Alan Beaulieu as a reference text. Any essential book, Structured Query Language, will serve you well.

Learn SQL. Learn PostgreSQL.

First Exercise

The first exercise asks you to retrieve all the data from a specific table.

Learn SQL. First Exercise 1

At the top of the screen is an entity relationship map of the tables in the database. The table requested in the exercise is named cd.facilities.

If you use the hint button (next to the Your Answer line) you will see the following:

Learn SQL. First Exercise 2

This should be enough of a clue to allow you, with the aid of your SQL reference, to find the answer. Enter your query and click on the Eun Query button.

Learn SQL. First Exercise 3

The green check means that the answer is correct. But what if you did not get it correct. Scroll down and select the Answers and Discussion button.

Learn SQL. First Exercise 4

Not only do you see the answer to the question, but there is a detailed analysis of the answer.

Video Series?

I am so impressed wth these exercises that the Percona Community Team is in discussion of creating a series of videos on them. Not only that, on of my colleagues who is learning PostgreSQL is volunteering to work through the exercises so that the series will feel like a study group. And I will comment on the query, possible alternatives when they exist, and help you work through the ‘rough spots’.

If you want to work along, please do. Let us know where you struggle or the places we are redundant. Out goal is to provide a first class learning experience to help people learn SQL and PostgreSQL.

David Stokes

David Stokes is a Technology Evangelist for Percona Corporation, is the author of MySQL & JSON - A Practical Programming Guide, and resides in Texas.

See all posts by David Stokes »

Discussion

We invite you to our forum for discussion. You are welcome to use the widget below.

✎ Edit this page on GitHub