DB2 Table Delete Question

Target table T1 is getting deleted. Table T2 has the foreign key. We require that whenever a row from T1 is deleted, the corresponding row from T2 also be deleted.
Which option can be used?
a.ON DELETE RESTRICT
b.ON DELETE CASCADE
c.ON DELETE SET NULL
d.ON DELETE CHILD
e.ON DELETE MATCH

ON DELETE CASCADE

Questions by radibioinfo   answers by radibioinfo

Showing Answers 1 - 3 of 3 Answers

kalone

  • Jan 31st, 2010
 

ON DELETE CASCADE: If a row in the parent table is deleted, all the corresponding row in child tables will automatically be deleted.

ON DELETE RESTRICT: The delete operation on parent table is restricted if there is a matching row in child table.

So, ans to the above query should be ON DELETE CASCADE.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions