Monday, 18 July 2016

INTEGRITY CONSTRAINTS



Integrity constraints provide a way of ensuring that changes made to the database by authorised users do not result in a loss of data consistency. An integrity constraint can be any arbitrary predicate applied to the database. They may be costly to evaluate, so we will only consider integrity constraints that can be tested with minimal overhead.


DOMAIN CONSTRAINTS   

 

Domain constraints specify that the value of each attribute A must be an atomic value from the domain dom (A) for that attribute. Some data types associated with domains are given below;  

  • Standard numeric data types for integers (such as short-integer, integer, long-integer). 

  • Real numbers (float and double-precision float). 
  •         Characters, fixed-length strings, and variable-length strings.


ENTITY INTEGRITY

Entity integrity is a property that ensures that no records are duplicated and that no attributes that make up the primary key are NULL. It is the one of the properties necessary to ensure the consistency of the database.


Entity Integrity ensures that there are no duplicate records within the table and that the field that identifies each record within the table is unique and never null.

The existence of the Primary Key is the core of the entity integrity. Entity integrity specifies that the Primary Keys on every instance of an entity must be kept, must bt unique and must have values other than NULL.


REFERENTIAL INTEGRITY

Referential integrity is usually enforced by the combination of a primary key or candidate key (alternate key) and a foregin key. A foregin value must match an existing value of the parent table.Foregin hey based on data values and are purely logical not physical.

No comments:

Post a Comment