I have a question about cascading deletes and foreign key references: Let's assume the following tables:
ITEMX | ITEMY
------------------ | ------------
ID FKID_ITEMY | ID
1 1 | 1
2 1 |
There is a cascade delete on FKID_ITEMY such that if I delete a row in ITEMX, the corresponding item in ITEMY will be deleted. My question is:
Will the delete of row ID 1 in ITEMX delete row ID 1 in ITEMY?
Or will just delete row ID 1 in ITEMX because row ID 2 is still referencing row ID 1 in ITEMY?
In other words, I would like to see row ID 1 of ITEMY deleted when there are no more references to it. Will a cascade delete achieve this?