Hands-on task
PostgreSQL: foreign key with CASCADE
In the shop database, create the tables authors(id int PRIMARY KEY, name text) and books(id int PRIMARY KEY, author_id int, title text), where author_id is a foreign key to authors(id) with the ON DELETE CASCADE rule.
- foreign key
- references
- on delete cascade
- referential integrity
- postgresql