delimiter // CREATE TRIGGER removeforeing BEFORE DELETE ON products FOR EACH ROW BEGIN DELETE FROM sales_details WHERE product_code = OLD.product_code; END// delimiter ;