MySQL: How to make a trigger that updates a table after a deletion in a related table?
I have a database with 2 relevant tables: animals and movement. The movement table tracks animal movements. The animals table has animal_id as the primary key, and which is a foreign key in the movement table. I want to make a trigger that deletes any relevant rows in the movement table when an animal is deleted from the animals table.