TEC 5323 Advanced Database Technology
Project 4 Triggers
Background: |
One of the important challenges to a database management system (DBMS) is to maintain valid data among all tables if some changes occur with one table. For example, in "PARTS" table, it consists of the following information:
The quantity "ONHAND" needs to be updated due to customer's order. If a customer has ordered one fax machine, the "ONHAND" will has to be reduced from 277 to 276. This issue is referred to data integrity. In class note: chapter 5, the customers order information is processed through "ITEMS" table. Typical data in "ITEMS" table look as follows.
This table is typically used to record customers' orders. The "QUANTITY" column represents the number of any particular parts ordered by the customer. Now the challenge to the DBMS is to update the "PARTS" table automatically corresponding to the changes in "ITEMS" table. This challenge is effectively solved by using database triggers. |
|||||||||
Task: |
You will need to run the script "chap05.sql" before working at this project, in a similar way to what you have worked at the class note. This action will help create consistent results. Your task is to create a database trigger in your database schema to maintain the data integrity in "PARTS" and "ITEMS" tables. Specifically, the following business rules need to be applied:
|
|||||||||
Report: |
|
|||||||||
Due: |
|
School of Technology
College of Business & Applied Sciences
Eastern Illinois University