Key Attributes of an Entity Type

For Complete YouTube Video: Click Here

In this class, we will understand the Key Attributes of an Entity Type.

We have already discussed the ‘simple and composite attributes,’ ‘single and multi-valued attributes,’ and ‘stored and derived attributes.’

Key Attributes of an Entity Type

Attributes whose values uniquely identify each entity of an entity type are called ‘key attributes.’

This concept is fundamental to understand.

Example

To understand this concept clearly, we will consider the following examples.

Example 1

The image below is example 1.

Key Attributes of an Entity Type Ex 1
Key Attributes of an Entity Type Ex 1

In the above example, we have an employee entity type with name, ID, and address as the attributes.

From the above example, which attribute is the key attribute.

Can the name attribute be the key attribute?

No, it cannot be the ‘key attribute’ because two are more employees can have the same names.

Similarly, two are more employees may live at the same address.

The ID attribute of the employee entity type is the ‘key attribute.’

The ID value of no two employees can be the same.

So, the ID attribute is the attribute that identifies each employee uniquely.

The key attribute for the employee entity type is the ID attribute.

Example 2

The image below is example 2.

Key Attributes of an Entity Type Ex 2
Key Attributes of an Entity Type Ex 2

In the above example, we have car entity type with make, model, color, and Registration number as the attributes.

Before reading further, guess the ‘key attribute.’

Make, Model, Color cannot be the ‘key attributes’ because the values may repeat, and we cannot identify the car uniquely.

The registration number is the attribute that identifies every car uniquely.

The registration number uniquely identifies every entity in the car entity type.

Example 3

The image below is example 3.

Key Attributes of an Entity Type Ex 3
Key Attributes of an Entity Type Ex 3

In the above example, we have student entity type with name, ID, and Phone number as the attributes.

You can easily guess by now the ‘key attribute’ is ID.

Phone numbers cannot be a unique ID.

Two or more students can share a number.

Example 4

The image below is example 4.

Key Attributes of an Entity Type Ex 4
Key Attributes of an Entity Type Ex 4

In the above example, we have Indian citizens entity type with name, address, phone number, and aadhar number as the attributes.

The ‘Key attribute’ is Aadhar Number.

ER-Diagram Representation

In ER-Diagrams, we underline the ‘key attributes, as shown below.

Key Attributes of an Entity Type Ex 4
Key Attributes of an Entity Type Ex 4