Referential Integrity and Business Rules

Posted on in Programming

Referential Integrity and Business Rules Referential integrity and business rules are two subjects that individuals new to database design find confusing. Relational databases use tables to represent things and events. It is often necessary for a table to refer to another table. In this case, the two tables have a relationship. Referential integrity ensures that the relationship between tables are error-free by guaranteeing that a foreign key in one table refers to an existing primary key in another table. A foreign key is any field in a table that acts as a pointer to another table. A table's primary key is a field that contains only unique values. This field acts as the identifier for each object in the table. By virtue of its uniqueness, the primary key can be guaranteed to refer to one and only one object in the table (Halpin & Morgan, 2008).

Business rules are external factors that influence database design. These rules define the operation of the business and restrict how the database should function. They may, for example, limit the range of input allowed in a particular field. Additionally, business rules may define the relationships that exist between tables in a database. If these rules change, the design of the database must be altered to compensate for the change (Hernandez, 2004). Although many business rules can be implemented at the application level, it is unavoidable that certain business rules must be implemented in the database.

References

Halpin, T. & Morgan, T. (2008). Information modeling and relational databases (2nd ed.). Burlington, MA : Elsevier/Morgan Kaufman Publishers.

Hernandez, M. J. (2003). Database design for mere mortals: A hands-on guide to relational database design (2nd ed.). Boston: Pearson.

My Bookshelf

Reading Now

Other Stuff