INTEGRITY RULES
Data integrity is to be maintained at any cost. If data loses integrity it becomes
garbage. So every effort is to be made to ensure data integrity is maintained. The
following are the main integrity rules that are to be followed.
Domain integrity : Data is said to contain domain integrity when the value of a column is derived from
the domain. Domain is the collection of potential values. For example, column date of
joining must be a valid date. All valid dates form one domain. If the value of date of
joining is an invalid date, then it is said to violate domain integrity.
Entity integrity : This specifies that all values in primary key must be not null and unique. Each entity
that is stored in the table must be uniquely identified. Every table must contain a
primary key and primary key must be not null and unique.
Referential Integrity : This specifies that a foreign key must be either null or must have a value that is
derived from corresponding parent key. For example, if we have a table called
BATCHES, then ROLLNO column of the table will be referencing ROLLNO column of
STUDENTS table. All the values of ROLLNO column of BATCHES table must be derived
from ROLLNO column of STUDENTS table. This is because of the fact that no student
who is not part of STUDENTS table can join a batch
No comments:
Post a Comment