Databases — Study Guide

Start here. This page is the map of the module: what each lesson covers, how to work through it, and what to install before the first session.

Module Map

#LessonSlidesReadingPractice
01Relational Modelling deck note lab 01
02Querying— note—

How to Study This Module

  1. Before the session, skim the note's objectives and summary: ten minutes.
  2. In the session, follow the slides and answer every check question before the reveal.
  3. After it, read the note in full and do each Try it before opening its answer.
  4. Do the lab, then the note's knowledge check. A question you miss names the section to reread.

The examples build one domain, so a lesson you skip leaves a gap in the next one.

Environment Setup

ComponentVersionCheck it works
PostgreSQL16 (14 or later behaves the same here)psql --version
A SQL clientanyconnects and runs SELECT 1;

Create a scratch database you can drop and recreate freely:

createdb library_scratch

The Running Example

A small library catalogue: authors write books, a book can have several authors, and books are lent to members. Every example and lab in the module uses it.

Glossary

Normalization
Organising columns so each fact is stored once.
Surrogate key
A key with no meaning outside the database.