+ 3

ON UPDATE CASCADE, ON DELETE CASCADE

please how does this two works on two relational tables?

25th Jan 2017, 6:30 PM
ARB
ARB - avatar
2 Réponses
+ 1
tnx
25th Jan 2017, 7:33 PM
ARB
ARB - avatar
0
Let's assume that a parent and child table exists where the parent and child link back into one another on a KEY. ON DELETE CASCADE on the parent key will delete all children that depend on that parent. ON UPDATE CASCADE on a parent will update the referenced key in the child. Personally, this is bad practice as it renders your table column's keys unreliable.
25th Jan 2017, 6:48 PM
Louis Milotte
Louis Milotte - avatar