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.
/ lessons
Lessons
6 lessons · 2 h 15 min
- 01identity and defaults↳ continue from here#identity#serial#default20m
- 02NOT NULL, PK, natural vs surrogate key↳ continue from here#primary-key#not-null#surrogate-key20m
- 03Foreign keys (CASCADE/SET NULL)↳ continue from here#foreign-key#on-delete#cascade25m
- 04UNIQUE and CHECK (NULLS NOT DISTINCT)↳ continue from here#unique#check#nulls-not-distinct20m
- 05Generated columns and domains↳ continue from here#generated-columns#virtual#stored25m
- 06ALTER TABLE: a migration mindset↳ continue from here#alter-table#migrations#locks25m