I have two tables as students and certificates, I need to delete the certificates related to a particular student from the certificates table when deleting a student from the student table. I am not much familiar with mysql triggers. please assist me.
this is what I've tried but I not sure it is correct
DELIMITER $$
CREATE TRIGGER delCerts AFTER DELETE ON students
FOR EACH ROW
BEGIN
DELETE FROM certificates as certs WHERE certs.stCode = students.stCode;
END;
$$