Skip to main content
Pollinaytepollinayte.Search
TechnologyBeginner

PostgreSQL Basics

A hands-on first course in SQL with PostgreSQL and psql, for complete beginners.

Ten short, hands-on lessons that take you from your first SELECT to joins and constraints in PostgreSQL, using a small community-garden database and real psql sessions.

  • 26m
  • 12 lessons
  • Certificate of completion

Published by Pollinayte. Created by Pollinayte Editorial.

About this course

Learn PostgreSQL by doing. In ten short, hands-on lessons you'll query a small community-garden database in psql, the PostgreSQL command-line client, and practice every step yourself.

Every command, result and error message you see on screen was recorded from a real PostgreSQL session, so what you see is exactly what you'll get when you try it.

What you'll do

  • Read, filter, sort and match rows with SELECT, WHERE, ORDER BY, LIKE, IN and BETWEEN
  • Handle missing values with IS NULL and COALESCE
  • Summarize data with COUNT, SUM, AVG, GROUP BY and HAVING
  • Create tables, insert rows, and update and delete safely inside transactions
  • Join tables and let keys and constraints protect your data

Before you start

You need PostgreSQL installed and psql working. The starter file garden-postgres.sql is in the first lesson.

--- Pollinayte is not affiliated with or endorsed by the PostgreSQL Community Association. PostgreSQL and Postgres are registered trademarks of the PostgreSQL Community Association of Canada.

What you will learn

  • Connect to a database and read rows from a table.
  • Narrow and order results with WHERE, ORDER BY and LIMIT.
  • Match patterns, lists and ranges with LIKE, IN and BETWEEN.
  • Find, fill and sort missing values with IS NULL and COALESCE.
  • Summarize a whole table with COUNT, SUM, AVG, MIN and MAX.
  • Summarize groups with GROUP BY and filter them with HAVING.
  • Define a table with sensible types and insert rows.
  • Update and delete only the rows you mean to.
  • Combine tables with inner joins and LEFT JOINs.
  • Use keys and constraints to keep data consistent.

Free preview: Your First Query in PostgreSQL

Curriculum

Module 1: Reading Data5 lessons
  1. Starter Files: the Garden DatabaseFree preview1m
  2. Your First Query in PostgreSQLFree preview2m
  3. Filtering and Sorting Rows2m
  4. Matching Text, Lists and Ranges2m
  5. Working with Missing Values2m
Module 2: Summarizing Data2 lessons
  1. Counting and Totals2m
  2. Grouping Results2m
Module 3: Changing and Connecting Data5 lessons
  1. Creating Tables and Adding Rows2m
  2. Changing Data Safely2m
  3. Joining Tables2m
  4. Keys and Constraints2m
  5. PostgreSQL Basics: Course Check5m

Who it is for

  • Complete beginners to databases and SQL
  • Analysts, developers and students who want hands-on PostgreSQL practice

Before you start

  • PostgreSQL installed with psql working (see SQL100 Lesson 3: Install and Connect to PostgreSQL)
  • Comfort typing commands in a terminal

Back to all courses