DROP TRIGGER IF EXISTS `inquiresTriggers`;
DELIMITER //
CREATE TRIGGER `inquiresTriggers` AFTER UPDATE ON `student_inquiries`
FOR EACH ROW BEGIN
/*If followed status changed*/
if NEW.`followed` <> OLD.`followed` THEN
/*First follow up*/
IF NEW.`followed` = 'followUpOne' THEN
INSERT IGNORE INTO `followUpOne`(`inquiryId`, `operator`, `date`, `comment`) SELECT `No`,`Operator`,`Date`,`Comment` FROM `student_inquiries` WHERE `followed` = 'followUpOne' ;
END IF;
/*Second follow up*/