DELIMITER $$
CREATE TRIGGER enroll_trigger
AFTER INSERT
ON enroll
FOR EACH ROW
BEGIN
   DECLARE studentname VARCHAR(255);
   SELECT sname
   INTO studentname
   FROM student
   WHERE sid = new.studentid;
   insert into debug values(concat(new.eid,' ',studentname));
   INSERT INTO enrollextended
      values(new.eid,studentname,new.studentid,new.sectionid,new.grade);
END $$
DELIMITER ;


