drop trigger if exists purch_before_delete; DELIMITER // create trigger purch_before_delete after delete on dbr_purch for each row begin delete from dbr_purch_bd where purch_id = old.id; END// DELIMITER ;