Answered step by step
Verified Expert Solution
Link Copied!

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
1. Table COMPANY with the following fields, employee_id, first_name, last_name , email, phone_number, hire_date, job_id, salary, commission_pct, manager_id, and department_id
2. Table AUDIT which have three fields emp_id, salary and edit_time
Write the following triggers:
1. Whenever an employee data is inserted into the COMPANY table a corresponding entry must be made in the AUDIT table.
2. 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
1. Table COMPANY with the following fields, employee_id, first_name, last_name , email, phone_number, hire_date, job_id, salary, commission_pct, manager_id, and department_id
2. Table AUDIT which have three fields emp_id, salary and edit_time
Write the following triggers:
1. Whenever an employee data is inserted into the COMPANY table a corresponding entry must be made in the AUDIT table.
2. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions

Question

A 300N F 30% d 2 m Answered: 1 week ago

Answered: 1 week ago

Question

Additional Factors Affecting Group Communication?

Answered: 1 week ago