Command Palette

Search for a command to run...

Hectal
Phase 2Beginner3 of 18 in Database Design

Keys, IDs and Constraints

Super, candidate, primary, natural and surrogate keys; ID generation from sequences to UUIDv7 and Snowflake; and the constraints (NOT NULL, UNIQUE, CHECK, FK actions, deferrable, exclusion) that keep data correct.

Keys give rows identity; constraints are rules the database enforces for every client, every time. Pushing rules into the schema is the cheapest correctness you will ever buy.

0/3 · 0%
3 topics ~27 min 5 code blocks & diagrams
Start with the first topic