DELIMITER//
CREATE PROCEDURE calcular descuento(
IN compra DECIMAL(10,2)
)
BEGIN
DECLARE descuento DECIMAL (10,2);
DECLARE total DECIMAL (10,2);
DECLARE porsentaje DECIMAL (5,2);
IF compra >=2000 THEN
SET porsentaje =20;
ELSEIF compra >1000 THEN
SET porsentaje =10;
To embed this project on your website, copy the following code and paste it into your website's HTML: