Assignment Triggers
Assignment Triggers
Assignment
Database Systems
Course Title: Course Code: CSC270 Credit Hours: 4(3,1)
Course Programme
Modassir Ishfaq BCE
Instructor/s: Name:
Semester: 4th Batch: Fa23 Section: A&B Date:
Time Allowed: Within 3 days Maximum Marks: 10
Student’s Name: Reg. No.
Question:
You are managing the backend of an online store. Customers place orders, and the system must deduct
inventory and record the transaction safely. The following tables are in use:
You want to audit all changes (INSERT, UPDATE, DELETE) on orders table and record them in an
AuditLog_orders table with information such as Operation type (INSERT / UPDATE / DELETE), User ID,
orderID, Timestamp of change. In case of deletion, the data must be logged in a separate table. In case of
update, it must log the attribute, its old value and new value in another separate table. Therse separate tables
must have a link with the auditlog ID.