There are two types of relational integrity rules
Entity Integrity: - No attribute participating in the primary key of a base relation allowed containing any nulls. Primary key performs the unique identification function in a relational model. Thus a null primary key value within a base relation would be like saying that there was some entity that had no known identity. An entity that cannot be identified is a contradiction in terms, hence the name entity integrity.
Referential integrity: - A referential integrity constraint designates a column or combination of columns as a foreign key and establishes a relation ship between the foreign key and a specified primary or unique key, called the referenced key. or The value that appears in one relation for a given set of attributes also appears for a certain set of attributes in another relation is called Referential Integrity. If the Base Relation/Table includes a foreign key matching Primary key of some other base table relation. Then every value of the Foreign Key in the First table/Relation must either be equal to the value of Primary Key in some tuple of the second table or be the wholly null. Or in other words a Foreign Key value must match primary key value in some tuple of the referenced relation if that foreign key value is non-null. Sometimes it is necessary to permit foreign keys to accept nulls. Here it must be noted that the nulls are of the variety value does not exist’ rather than ‘Value unknown’.