Integrity

Integrity is a serious and complex issue in relational database management. In general, it means the consistency of the data in the database. Inconsistencies in data arise in several ways. System failure—a hardware problem, a software bug, or a logical error in an application program—can introduce one kind of inconsistency. Relational database management systems that protect data from this type of inconsistency do so by guaranteeing that SQL commands either run to completion or are canceled. The processes by which this guarantee is enforced are often called transaction management. Transactions and SQL's method of handling them are discussed in Chapter 10.

Another kind of integrity, entity integrity, is a design issue. Entity integrity requires that no primary key be allowed to have a null value.

A third variety of data integrity, referential integrity, is consistency among pieces of information that are repeated in more than one table. For example, if you correct an employee's improperly entered Social Security number in one table, other tables that include employee information probably still reference the old number, so you have to update them, too. It's vital that when information is changed in one place, it is also changed in every other place it appears.

Codd's rules firmly state that relational database management systems should support not only entity and referential integrity but also additional integrity constraints reflecting business policies or government regulations and so forth. Furthermore integrity constraints must be

  • Definable in the same high-level language used by the rest of the system

  • Stored in the system catalogs, not in application programs

In the early days, only a few implementations of SQL met Codd's integrity criteria, but this is changing. The 1992 ANSI SQL standard provides for constraints in the CREATE TABLE statements that can enforce referential integrity and business rules. Most vendors have implemented these new features in some form. Constraints are covered in Chapter 3.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.234.225