Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Let us consider a case where we want to keep audit trail for every record being inserted in COMPANY table. To keep audit trail, we
Let us consider a case where we want to keep audit trail for every record being inserted in COMPANY table. To keep audit trail, we will create a new table called AUDIT where the log messages will be inserted, whenever there is an entry in COMPANY table for a new record.
For the given Company database
Create the following tables
Table COMPANY with the following fields, employeeid firstname, lastname email, phonenumber, hiredate, jobid salary, commissionpct managerid and departmentid
Table AUDIT which have three fields empid salary and edittime
Write the following triggers:
Whenever an employee data is inserted into the COMPANY table a corresponding entry must be made in the AUDIT table.
Whenever an update is made to the salary attribute of the COMPANY table, the update must also reflect in the AUDIT table.
Let us consider a case where we want to keep audit trail for every record being inserted in COMPANY table. To keep audit trail, we will create a new table called AUDIT where the log messages will be inserted, whenever there is an entry in COMPANY table for a new record.
For the given Company database
Create the following tables
Table COMPANY with the following fields, employeeid firstname, lastname email, phonenumber, hiredate, jobid salary, commissionpct managerid and departmentid
Table AUDIT which have three fields empid salary and edittime
Write the following triggers:
Whenever an employee data is inserted into the COMPANY table a corresponding entry must be made in the AUDIT table.
Whenever an update is made to the salary attribute of the COMPANY table, the update must also reflect in the AUDIT table.
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