Question
SQL Code-In this question you will create a Trigger. The trigger watches any UPDATE on the EMPLO table and record them in the SAL_HIST table.
SQL Code-In this question you will create a Trigger. The trigger watches any UPDATE on the EMPLO table and record them in the SAL_HIST table. View the schema of both tables before you start. (Code for table creation attached)Create a trigger that add a new record in the SAL_ HIST table ONLY WHEN an update is made on the SALARY field of the EMPLOYEES table. Reject any increase more than 75% of the old salary with a proper application error message.Write a SQL statement for Update the SALARY of employee_id 110 to 8900?
CREATE TABLE SAL_HIST (TR_ID NUMBER GENERATED ALWAYS AS IDENTITY PRIMARY KEY, EMP_ID NUMBER, OLD_SAL NUMBER, NEW_SAL NUMBER, DATE_CHANGE DATE ); SELECT * FROM SAL_HIST;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started