<!-- 创建trriger-->
DROP TRIGGER IF EXISTS after_insert_into_classes_teacher_rel ;
CREATE TRIGGER after_insert_into_classes_teacher_rel
AFTER INSERT ON classes_teacher_rel
FOR EACH ROW
BEGIN
UPDATE classes set num_of_teacher =num_of_teacher+1
WHERE id = new.classes_id;
END;
<!-- 查看trrigger-->
SHOW TRIGGER;