drop trigger if exists porder_bd_before_delete; DELIMITER // create trigger porder_bd_before_delete before delete on dbr_porder_bd for each row begin delete from dbr_purch_bd where porder_bd_id = old.id; END// DELIMITER ;