Integrity
Database integrity means the correctness and consistency of data. It is another form of database protection. Security means that the data must be protected from unauthorized operations.
Integrity is related to the quality of data. Integrity is maintained with the help of integrity constraints. These constraints are the rules that are designed to keep data consistent and correct. They act like a check on the incoming data. It is very important that a database maintains the quality of the data stored in it.DBMS provides several mechanisms to enforce integrity of the data.
Types of Integrity
Two types of data integrity are as follows:
Entity Integrity
The entity integrity is a constraint on primary key value. It states that any attribute of a primary key cannot contain null value. If primary key contains null value, it is not possible to uniquely identify a record in a relation. Entity integrity ensures that it should be easy to identify each entity in the database.
Referential Integrity
The referential integrity is a constraint on foreign key value. It states that if a foreign key exists in a relation, the foreign key value match the primary key value of some tuple in its parent relation. Otherwise the foreign key value must be completely null.
Database integrity means the correctness and consistency of data. It is another form of database protection. Security means that the data must be protected from unauthorized operations.
Integrity is related to the quality of data. Integrity is maintained with the help of integrity constraints. These constraints are the rules that are designed to keep data consistent and correct. They act like a check on the incoming data. It is very important that a database maintains the quality of the data stored in it.DBMS provides several mechanisms to enforce integrity of the data.
Types of Integrity
Two types of data integrity are as follows:
Entity Integrity
The entity integrity is a constraint on primary key value. It states that any attribute of a primary key cannot contain null value. If primary key contains null value, it is not possible to uniquely identify a record in a relation. Entity integrity ensures that it should be easy to identify each entity in the database.
Referential Integrity
The referential integrity is a constraint on foreign key value. It states that if a foreign key exists in a relation, the foreign key value match the primary key value of some tuple in its parent relation. Otherwise the foreign key value must be completely null.