"Cascade" delete in MySql ?

admin

Administrator
Staff member
MS Access has this type of delete or update, where (assuming your table relationships are defined correctly) that if you delete an entry in the master table, that particular related entry is also deleted in the slave table.

For example, if a person's telephone number is the primary key in table 1, and is also a foreign key in table 2, any deletion of that person's record in table 1 will also result in its deletion in table 2. This is quite handy to have, esp. for data integrity purposes! And this seems to occur as an MS Access transaction, meaning both entries are deleted OR the whole operation is aborted.

So does MySql have anything like this kind of operation (for either deletions or updates)? I could always do this as two separate transactions, but if this is otherwise available, why bother with the extra details?
 
Top