Question: This question is regarding Triggers I have two tables as emp and emp_backup whenever i update salary on emp table the Trigger must update salary

This question is regarding Triggers

I have two tables as emp and emp_backup whenever i update salary on emp table the Trigger must update salary on emp_backup table also : schema creation code is like this:

CREATE TABLE emp ( fname VARCHAR(45), lname VARCHAR(45), Emp_id INT, salary INT, Notes VARCHAR(45), ); INSERT INTO emp(fname, lname, Emp_id, salary, Notes) VALUES ('John', 'Sen', 001, 1000, 'Experienced'); INSERT INTO emp(fname, lname, Emp_id, salary, Notes) VALUES ('Shawn', 'Mendis', 002, 2000, 'Good'); INSERT INTO emp(fname, lname, Emp_id, salary, Notes) VALUES ('Brian', 'lori', 003, 3000, 'Poor'); INSERT INTO emp(fname, lname, Emp_id, salary, Notes) VALUES ('Saurab', 'Gill', 004, 4000, 'Experienced'); INSERT INTO emp(fname, lname, Emp_id, salary, Notes) VALUES ('Suraj', 'Rao', 005, 5000, 'Excellent'); INSERT INTO emp(fname, lname, Emp_id, salary, Notes) VALUES ('nicholos', 'glor', 006, 6000, 'poor'); INSERT INTO emp(fname, lname, Emp_id, salary, Notes) VALUES ('Johnson', 'joy', 007, 7000, 'Experienced'); INSERT INTO emp(fname, lname, Emp_id, salary, Notes) VALUES ('JJ', 'rayan', 008, 8000, 'Experienced'); INSERT INTO emp(fname, lname, Emp_id, salary, Notes) VALUES ('Thompson', 'Ben', 009, 9000, 'Experienced'); INSERT INTO emp(fname, lname, Emp_id, salary, Notes) VALUES ('Dhruv', 'Rao', 001, 1000, 'Experienced');

SAME goes with emp_backup table creation. Please provide me the Trigger solution code for this, i'm using Mysql workbench and MS SQL server

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!