Entity integrity
Encyclopedia
In the relational data model, entity integrity is one of the three inherent integrity rules
. Entity integrity is an integrity rule which states that every table must have a primary key and that the column or columns chosen to be the primary key should be unique and not null.
A direct consequence of this integrity rule is that duplicate rows are forbidden in a table. If each value of a primary key must be unique no duplicate rows can logically appear in a table. The NOT NULL characteristic of a primary key ensures that its value can be used to identify all rows in a table.
Within relational databases using SQL
, entity integrity is enforced by adding a primary key clause to a schema definition.
The system enforces Entity Integrity by not allowing operations (INSERT, UPDATE) to produce an invalid primary key. Any operation that is likely to create a duplicate primary key or one containing nulls is rejected.
The Entity Integrity ensures that the data that you store remains in the proper format as well as comprehensible.
Database integrity
Database integrity ensures that data entered into the database is accurate, valid, and consistent. Any applicable integrity constraints and data validation rules must be satisfied before permitting a change to the database....
. Entity integrity is an integrity rule which states that every table must have a primary key and that the column or columns chosen to be the primary key should be unique and not null.
A direct consequence of this integrity rule is that duplicate rows are forbidden in a table. If each value of a primary key must be unique no duplicate rows can logically appear in a table. The NOT NULL characteristic of a primary key ensures that its value can be used to identify all rows in a table.
Within relational databases using SQL
SQL
SQL is a programming language designed for managing data in relational database management systems ....
, entity integrity is enforced by adding a primary key clause to a schema definition.
The system enforces Entity Integrity by not allowing operations (INSERT, UPDATE) to produce an invalid primary key. Any operation that is likely to create a duplicate primary key or one containing nulls is rejected.
The Entity Integrity ensures that the data that you store remains in the proper format as well as comprehensible.
See also
- Relational database management systemRelational database management systemA relational database management system is a database management system that is based on the relational model as introduced by E. F. Codd. Most popular databases currently in use are based on the relational database model....
- Structured Query Language (SQL)SQLSQL is a programming language designed for managing data in relational database management systems ....
- Referential integrityReferential integrityReferential integrity is a property of data which, when satisfied, requires every value of one attribute of a relation to exist as a value of another attribute in a different relation ....