For Entity Integrity Rule, each table has a Primary Key.
Primary Key cannot have NULL value.
<Student>
Student_ID | Student_Awards | Student_Awards |
Above, you can see our primary key is Student_ID. We cannot consider Student_Awards as the primary key since not every student would have received the award.
Let us see another example −
<Employee>
Employee_ID | Employee_Name | Employee_Age | Employee_Location |
In the above table, the Primary Key is Employee_ID
Let us now summarize the Entity Integrity Rule −
- Make sure that each tuple in a table is unique.
- Every table mush has a primary key, for example, Student_ID for a Student table.
- Every entity is unique.
- The relations Primary Key must have unique values for each row.
- Primary Key cannot have NULL value and must be unique.
- Example can be an Employee_ID cannot be null in an Employee table.