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. In the session, follow the slides and answer every check question before the reveal.
  2. After it, read the lesson's topic in the lecture note, then do the lab.
  3. Before the theory exam or an interview, reread the note's summary and answer its review questions before opening each answer. A question you miss names the topic 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.