CREATE TRIGGER `before_delete` BEFORE DELETE ON `barcode_master` FOR EACH ROW BEGIN UPDATE library_emp_master SET job_type = 1 WHERE barcode_no = OLD.barcode_no; END;