MySql creates a delete trigger

Syntax for creating triggers using MySqlWorkbench

DELIMITER|
CREATE TRIGGER <触发器名> AFTER DELETE ON student
FOR EACH ROW BEGIN
	DELETE FROM Grade WHERE stuId=old.stuId;
END;
|
DELIMITER;

The above is to create a trigger on the student table, when a record is deleted from the student table, the corresponding student information in the score table will be deleted

Guess you like

Origin blog.csdn.net/qq_45465526/article/details/103586050