Oct 16, 2024
salary column to the employees table.
ALTER TABLE employees ADD COLUMN salary DECIMAL(10,2) AFTER hourly_pay;salary = hourly_pay * 2080 (since there are 2080 work hours per year).
salary when hourly_pay is updated.
before_hourly_pay_updatehourly_pay, set new.salary = new.hourly_pay * 2080.hourly_pay and observe automatic salary update.before_hourly_pay_insertnew.salary = new.hourly_pay * 2080.salary is set correctly.*expenses with columns expense_id, expense_name, expense_total.after_salary_deleteexpense_total by old.salary where expense_name = 'salaries'.after_salary_insertexpense_total by new.salary.after_salary_updateexpense_total by the difference between new.salary and old.salary.