I'm wanting to create a discount trigger for if the user selects the payment method 6 that is billet he has 15% discount in the amount that will be paid, then the ValuePagar q is where the value that the person will get is to receive the discounted value
CREATE TRIGGER Desconto BEFORE INSERT
ON Pagamento
FOR EACH ROW
BEGIN
IF NEW.CodigoFormaPagamento = 6 THEN
SET NEW.ValorPagar = (NEW.ValorPagar * 0.15);
END IF;
END;