/ config

Settings

Theme
Language

Lesson text

Pick a typeface and size that make long lessons comfortable to read.
Font
Size
S

Code text

consumer.subscribe(topics)
Font
Size
XS

Progress

Free readingUnlock every lesson and hide progress
ResourcesGitHub repositorycourse source code→
/ contents

Course outline

0 / 63 (0%)
    1. 01identity and defaults20m
    2. 02NOT NULL, PK, natural vs surrogate key20m
    3. 03Foreign keys (CASCADE/SET NULL)25m
    4. 04UNIQUE and CHECK (NULLS NOT DISTINCT)20m
    5. 05Generated columns and domains25m
    6. 06ALTER TABLE: a migration mindset25m
HomeGitHub repository
03/ 11·6 lessons·2 h 15 min

Schema

Identity vs serial, NOT NULL, primary and foreign keys, UNIQUE/CHECK, generated columns and domains (PG18 virtual vs stored), and a migration mindset — which ALTERs are instant and which rewrite the table and block writes.

Start module→Continue · identity and defaults→Reread module→Next module →
Progress0 / 6
0%
Lessons
6
Duration
2 h 15 min
Stack
Go
/ lessons

Lessons

6 lessons · 2 h 15 min
  1. 01✓identity and defaults↳ continue from here#identity#serial#default20m→
  2. 02✓NOT NULL, PK, natural vs surrogate key↳ continue from here#primary-key#not-null#surrogate-key20m→
  3. 03✓Foreign keys (CASCADE/SET NULL)↳ continue from here#foreign-key#on-delete#cascade25m→
  4. 04✓UNIQUE and CHECK (NULLS NOT DISTINCT)↳ continue from here#unique#check#nulls-not-distinct20m→
  5. 05✓Generated columns and domains↳ continue from here#generated-columns#virtual#stored25m→
  6. 06✓ALTER TABLE: a migration mindset↳ continue from here#alter-table#migrations#locks25m→
← Previous moduleData typesNext module →CRUD fluency