Thursday 2 April 2020

INTEGRITY CONSTRAINTS


 INTEGRITY CONSTRAINTS
Integrity constraints specific to a particular relational data base must be definable in the relational data sub-language and storable in the catalog, not in the application programs.
If a column only accepts certain values, then it is the RDBMS which enforces these constraints and not the user program, this means that an invalid value can never be entered into this column, whilst if the constraints were enforced via programs there is always a chance that a buggy program might allow incorrect values into the system.

¨      In order to be considered relational, data integrity must be an internal function of the DBMS; not the application program
¨      Data integrity means the consistency and accuracy of the data in the database (i.e., keeping the garbage out of the database)
¨      There are three types of data integrity: entity, domain, and referential
¨      Within the database, data integrity can be enforced procedurally or declaratively
¨      Declarative data integrity involves placing or ‘declaring’ constraints on columns
¨      Procedural data integrity is maintained through code (i.e., through stored procedures or triggers)
Types of Integrity Constraints
Integrity constraints on a database may be divided into two types:
  1. Static Integrity Constraints - these are constraints that define valid states of the data. These constraints include designations of primary keys etc.
  2. Dynamic Integrity Constraints - these are constraints that define side-effects of various kinds of transactions (e.g. insertions and deletions).




No comments:

Post a Comment