0
CREATE TRIGGER aumentarsalario
AFTER INSERT
ON empregados
FOR EACH ROW
BEGIN
UPDATE EMPREGADOS SET SALARIO = NEW.SALARIO * (NEW.SALARIO*(10/100)) WHERE NEW.SALARIO < 900;
END IF
END
How do I put an extra 10% in a product? at which point am I missing.
I remembered, so I erased kkkk
– Wees Smith
@Euaelucas if what you need is to change all the records that have the salary less than 900 once, to
trigger
is not a viable output. The best way would be to create a function and run it only when needed. Thetrigger
will be executed every time a record is entered/updated/deleted, ie every time you register an employee, all employees who have less than 900 salary will receive a 10% increase, including what is being entered now.– Roberto de Campos