Caffeinated Coder
Book an appointment
Lesson 07 · Design

Keys and constraints

A table's definition can carry rules, and the DBMS checks every change against them. Meet the five everyday constraints (PRIMARY KEY, NOT NULL, UNIQUE, CHECK and FOREIGN KEY) by sending the same new book, Stardust, five times with one broken value each time. Watch PostgreSQL refuse each try with its own error, store the sixth, and then refuse to delete an author who still has books.

12 min8 steps5 questionsIntermediate
Fig 7 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.