新增触发器
CREATE TRIGGER `student_score_trigger` AFTER INSERT ON `student_score` FOR EACH ROW INSERT INTO student_score_trigger(coutent,student_score_id,name,score,code,subject) VALUES('学生成绩表插入了一条记录',new.id,new.name,new.score,new.code,new.subject);
修改触发器
CREATE TRIGGER `student_score_trigger_update` AFTER UPDATE ON `student_score` FOR EACH ROW INSERT INTO student_score_trigger(coutent,student_score_id,name,score,code,subject) VALUES('学生成绩表更新了一条记录',new.id,new.name,new.score,new.code,new.subject);
删除触发器
CREATE TRIGGER `student_score_trigger_delete` AFTER DELETE ON `student_score` FOR EACH ROW INSERT INTO student_score_trigger (
coutent,
student_score_id,
NAME,
score,
CODE,
SUBJECT
)
VALUES
(
'学生成绩表删除了一条记录',
old.id,
null,
null,
null,
null
);