Total Pageviews

Entity Integrity

An entity could be a person, place, thing or any real world object.

In SQL Server, each record of a table have an info regarding an entity. Let's take a real time example, we have employee as an entity which can be depicted as a "employee" table in SQL Server where we have column emp_id, emp_name, emp_address,..... etc. So here emp_id help us to identify the each record in table "employee" uniquely.

Here word "Unique" is most significant. Each employee has uniqueness or individual significance across the world. In employee table we can have more than one employee with same name but each employee should identify uniquely and must get unique employee id so that each employee can be identified individually or UNIQUELY.

To identify each record in a table uniquely, here ENTITY INTEGRITY concept comes into the picture.

The concept of Entity Integrity help us to define a row as a unique entity for a particular table. Entity integrity enforces the integrity of the key column, identifier columns or the primary key of a table, with the help of UNIQUE indexes, UNIQUE constraints or PRIMARY KEY constraints.

No comments:

Post a Comment