PG

PostgreSQL — Beginner

BeginnerPostgreSQL 16+ · 7 lessons

Learn databases from scratch with PostgreSQL: install it, create tables, add and change data, ask questions with SELECT, connect tables with keys, and summarise data with aggregates. Lessons build one school database step by step — run them in order.

Lessons

  1. 1Setting up PostgreSQL & psqlInstall PostgreSQL, connect with psql and create your first database.Solution4-question quiz
  2. 2Creating Tables & Data TypesCREATE TABLE, choosing data types, defaults, NOT NULL and ALTER TABLE.Solution4-question quiz
  3. 3Inserting, Updating & Deleting DataINSERT rows, see results with RETURNING, change them with UPDATE and remove them with DELETE.Solution4-question quiz
  4. 4Querying with SELECTFilter, sort, limit and compute with WHERE, ORDER BY, LIMIT, LIKE, IN and NULL checks.Solution4-question quiz
  5. 5Dates, Times & CASEDate arithmetic, intervals, extracting parts of dates, formatting, and conditional values with CASE.Solution4-question quiz
  6. 6Keys, Constraints & RelationshipsLink tables with foreign keys and protect data with UNIQUE and CHECK constraints.Solution4-question quiz
  7. 7Summarising Data: Aggregates & GROUP BYcount, sum, avg, min, max, GROUP BY and HAVING — plus a first look at JOIN.Solution4-question quiz
Start with lesson 1 →
Ask AI