|< < 29 > >|

Foreign keys and updates

CASCADE

Instead of blocking the action (i.e., update or deletion), cascade it, (i.e. propagate it).

  • Delete the referenced row: Delete the referencing row.

  • Update the referenced row's PK: Update the referencing row's FK.
create table P( p_id int not null primary key, x int ); create table F( f_id int not null primary key, p_id int references P on delete cascade on update cascade, y int );

|< < 29 > >|