Question: can someone help me? I need SQL management (triggers) for employ table to (update,after insert ,delete) salary column. for 100 salary column. this codes are

can someone help me? I need SQL management (triggers) for employ table to (update,after insert ,delete) salary column. for 100 salary column. this codes are working but t doesn't change any thing.

can someone help me? I need SQL management (triggers) for employ table

to (update,after insert ,delete) salary column. for 100 salary column. this codes

CREATE TRIGGER update_salary_after_insert AFTER INSERT ON employ FOR EACH ROW BEGIN UPDATE employ SET salary = salary +100 WHERE id = NEW.id; END; This trigger will update the salary column with an additional 100 for each new row that is inserted into the employ table. AFTER UPDATE [CREATE TRIGGER update_salary_after_update AFTER UPDATE ON employ FOR EACH ROW BEGIN UPDATE employ SET salary = salary +200 WHERE id = NEW.id; END; This trigger will update the salary column with an additional 200 for each row that is updated in the employ tab AFTER DELETE CREATE TRIGGER update_salary_after_delete AFTER DELETE ON employ FOR EACH ROW BEGIN UPDATE employ SET salary = salary 300 WHERE id = OLD.id; END; This trigger will update the salary column by subtracting 300 for each row that is deleted from the employ table

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!