Entity Integrity

Entity Integrity ensures that the table contains no duplicate records and that the field that identifies each entry is distinct and never null. The Primary Key’s presence is critical to the entity’s integrity. If a primary key is defined for each entity, the entity integrity rule is followed.

In other words, entity integrity requires that the Primary Keys on each instance of an entity be retained, unique, and have values other than NULL.

In his seminal paper, E. F. Codd stipulated that a primary key of an object, or any part of it, could never have a null value. [1] According to the relational model, every relation (or table) must have an identifier, known as the primary key (abbreviated PK), that allows every row of the same relation to be identified by its content, that is, by a unique and minimum value. The PK is a set of attributes that is not empty (or columns). Because each FK matches a preexisting PK, the foreign key (abbreviated FK) follows the same format.

Although most relational databases do not explicitly state that a table must have a Primary Key, it is best practice to create one for each table in the relational architecture.


–Table definition – Dept
DeptNo INT,
DName VARCHAR(14),
Loc VARCHAR(13),

— Tabe Definition – Emp: 
EmpNo INT,
EName VARCHAR(10),
Mgr INT,
HireDate date,
Sal INT,
Comm INT,
DeptNo INT,

As you can see, the DeptNo is a primary key in the Dept table, ensuring that each row of a table has a unique and non-null primary key value. Similarly, EmpNo in Emp table.

Hope you find this article helpful.

Happy learning!!

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s