Use Foreign Key constraints with “on delete cascade” option for fast automated delete of child records
Here is a demo example. 1) Set up example tables: CREATE TABLE parent ( parent_id number(10) not null, CONSTRAINT parent_pk PRIMARY KEY (parent_id) ); CREATE TABLE child ( child_id numeric(10) not null, parent_id numeric(10) not null, CONSTRAINT fk_child FOREIGN KEY (parent_id) REFERENCES parent(parent_id) ); insert into parent values (1) ; insert into child values (1,1) […]
Read More Use Foreign Key constraints with “on delete cascade” option for fast automated delete of child records