Look up documentation for triggers regarding ON INSERT and ON UPDATE
So (assuming you have already updated all your data to reflect your rules and are only moving forward):
#1 trigger will be ON/AFTER INSERT into EMP, set COMMISSION = 'Y' where Emp_type = 'Salesperson' ELSE COMMISION = 'N'
#2 trigger will be ON/BEFORE UPDATE only update if new:salary > old:salary
haven't made a trigger in a while so please look up the proper syntax etc.
Originally posted by mark00189
hi guys how can i write a trigger on myemp tabl to;
1. Sales persons should always receive commission. Employees who are not sales persons should never receive a commission;
2. Salaries may only be increased, never decreased.
you can lead someone to something but they will never learn anything ...