title: Oracle: delete parent table when child is deleted(Bidirectional Cascade Delete)
body: <p>Got a quick question.
  So I have a table called PARENT and a table called CHILD, assuming they are in parent-child relationship. Is it possible to delete one of them when the other table's data is deleted?</p>
  
  <p>My initial attempt is to use cascade delete to delete CHILD record When PARENT record is deleted.
  At same time I use trigger to delete PARENT record when CHILD's record is deleted.(condition is after delete on CHILD, fire trigger)</p>
  
  <p>The result is ORA-04091: Table is Mutating.
  It creates sort of deadlock. </p>
  
  <p>Parent table deleted-->cascade delete child --> trigger fires to delete parent,
  At this point, the deleted record in PARENT is not committed, so we are in a limbo state.</p>
  
  <p>Is it even possible to make Parent and Child table's record associated in this way, where if one is deleted the other one is killed as well? We are assuming that this CHILD table is the only child, and the column in CHILD with foreign key has a 1 to 1 relationship with referenced column in PARENT.</p>
  
  <p>Edit: I came to across oracle document for compound trigger, it's a interesting read. I will update it if it works out.</p>