Data Integrity

Broadly speaking, data integrity refers to the accuracy and consistency of the data in the database. Ideally, database software would provide a variety of mechanisms for checking on data integrity; unfortunately, several important kinds of integrity are unsupported by most relational systems.

In practice, many requirements for integrity are often met through special-purpose application code. The disadvantages of assigning the task of integrity control to application programs include the amount of extra work involved in writing and maintaining integrity-checking code, the potential for both duplicating work and introducing inconsistencies when more than one application uses the same database, and the ease with which constraints coded into applications can be bypassed by users with access to the underlying database.

There are several kinds of data integrity. At the most basic level, all database systems (not just relational ones) should be able to guarantee that a value being entered is the correct datatype and that it's within the range of values supported by the system. Different relational systems provide different assortments of datatypes, but all of them check values being entered and reject the data modification statement if the value is wrong for the specified datatype. The null status of the column is also checked on data entry. Finally, certain datatypes—usually character types—can (or must) be associated with user-specified lengths. Some systems reject data entries that exceed the maximum length for the datatype; others truncate the entered value to fit.

Three kinds of integrity are discussed in this section:

  • Domain constraints

  • Entity integrity

  • Referential integrity

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

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