Asee peer logo

Writing Triggers to Implement Business Rules in a Relational Database

Download Paper |


2021 ASEE Virtual Annual Conference Content Access


Virtual Conference

Publication Date

July 26, 2021

Start Date

July 26, 2021

End Date

July 19, 2022

Conference Session

Computing and Information Technology Division Technical Session 7

Tagged Division

Computing and Information Technology

Page Count


Permanent URL

Download Count


Request a correction

Paper Authors


Reza Sanati-Mehrizy Utah Valley University

visit author page

Reza Sanati-Mehrizy is a professor of Computer Science Department at Utah Valley University, Orem, Utah. He received his M.S. and Ph.D. in Computer Science from the University of Oklahoma, Norman, Oklahoma. His research focuses on diverse areas such as: Database Design, Data Structures, Artificial Intelligence, Robotics, Computer Aided Manufacturing, Data Mining, Data Warehousing, and Machine Learning.

visit author page


Afsaneh Minaie Utah Valley University

visit author page

Afsaneh Minaie is a Professor and Chair of Engineering Department at Utah Valley University. She received her B.S., M.S., and Ph.D. all in Electrical Engineering from University of Oklahoma. Her research interests include gender issues in the academic sciences and engineering fields, Embedded Systems Design, Mobile Computing, Wireless Sensor Networks, Nanotechnology, Data Mining and Databases.

visit author page

Download Paper |



Organizations have many business rules (constraints) to implement in their daily operations. This is done mainly by action assertions traditionally implemented in procedural logic buried deeply within user’s application program in a form that is virtually unrecognisable, unmanageable, and inconsistent. This approach places a heavy burden on the programmer, who must know all the constraints that an action may violate and must include checks for each of these constraints. An omission, misunderstanding, or error by the programmer will likely leave the database in an inconsistent state.

Entity Relationship (ER) model is a common conceptual database design tool used for relational database design. To enforce the business rules, some business rules can be included in this ER model in the form of constraints. However, including constraints in this graphical model is just a reminder for the programmer to include them in his database implementation. The problem is that constraint is very rigid and the database becomes programmer dependent and there is no grantee that programmer will include them in his implementation. An alternative solution for this problem is to implement the constraints in the form of triggers. Trigger is a program and is more flexible than a constraint. Trigger has Event, Condition and Action (ECA) property. When an event take place and consequently a condition becomes true, the trigger takes action automatically and modifies the database as needed.

In this paper, we use the ER notation to represent some business rules (constraints) graphically for a university database and write triggers to implement them to ensure the consistency of the data in the database.

Sanati-Mehrizy, R., & Minaie, A. (2021, July), Writing Triggers to Implement Business Rules in a Relational Database Paper presented at 2021 ASEE Virtual Annual Conference Content Access, Virtual Conference.

ASEE holds the copyright on this document. It may be read by the public free of charge. Authors may archive their work on personal websites or in institutional repositories with the following citation: © 2021 American Society for Engineering Education. Other scholars may excerpt or quote from these materials with the same citation. When excerpting or quoting from Conference Proceedings, authors should, in addition to noting the ASEE copyright, list all the original authors and their institutions and name the host city of the conference. - Last updated April 1, 2015