You are on page 1of 2

Integrity constraints

Integrity constraints
Integrity constraints are used to ensure accuracy and consistency of data in a relational database.[citation needed]

Types
Codd initially defined two sets of constraints but, in his second version of the relational model, he came up with four
integrity constraints: [citation needed]

Entity Integrity
The entity integrity constraint states that no primary key value can be null. This is because the primary key value is
used to identify individual tuples in a relation. Having null value for the primary key implies that we cannot identify
some tuples.This also specifies that there may not be any duplicate entries in primary key column key word.

Referential Integrity
The referential integrity constraint is specified between two relations and is used to maintain the consistency among
tuples in the two relations. Informally, the referential integrity constraint states that a tuple in one relation that refers
to another relation must refer to an existing tuple in that relation. It is a rule that maintains consistency among the
rows of the two relations in dbms.

Domain Integrity
Domain constraints allows us to test the values inserted into the database and to test the queries to make sure
comparisons made are appropriate.

User Defined Integrity


A business rule is a statement that defines or constrains some aspect of the business. It is intended to assert business
structure or to control or influence the behavior of the business. E.g.: Age>=18 && Age<=60

Article Sources and Contributors

Article Sources and Contributors


Integrity constraints Source: http://en.wikipedia.org/w/index.php?oldid=595171674 Contributors: A412, Abdull, Ae86, Agilius, Bulwersator, Byte, Donner60, Edison, Edward, FreeFlow99,
Jim1138, Jpvinall, Materialscientist, Nbarth, O paladin o, Pgr94, RenniePet, Ritesh104, Rubicon, Salvar, SqlPac, Sujitrumane, Tide rolls, Tyros1972, Victor falk, 79 anonymous edits

License
Creative Commons Attribution-Share Alike 3.0
//creativecommons.org/licenses/by-sa/3.0/

You might also like