Definitions of Entity Attribute and Entity Type

For Complete YouTube Video: Click Here

In this class, we will understand the Definitions of Entity, Attribute, and Entity Type.

We have already discussed the need for designing a database.

Definitions of Entity Attribute and Entity Type

Before we start our design of the company database, we will discuss some terminology.

This terminology helps us a lot while designing the database.

Entity

An entity is a real-world thing with Physical or Conceptual existence.

Consider the company database and try to guess the entities which have real-world or conceptual existence.

For example, consider employee, an employee in a company is an entity with physical existence.

All the employees e1, e2, e3, e100 are all entities with physical existence.

Similarly, projects and departments are the entities with conceptual existence.

For example, projects p1, p2, and departments d1, d2 are all entities with conceptual existence.

Attributes

The attribute is a property that describes an entity.

For example, consider an employee e1.

The properties that describe an employee e1 are a name, phone number, address, sex, and date of birth.

Similarly, The properties that describe a project p1 are a name, address, and controlling department.

For the department entity d1, the properties are name, number, and manager.

Entity Type

Entity Type defines a collection of entities that have identical attributes.

For example, consider all the entities like e1, e2, e3, p1, p2, d1, d2, and d3.

Grouping the entities with identical properties is called entity type.

That means we can group all the employees as they all have identical properties, and we can call that an employee entity type.

Similarly, we can group all the project entities and department entities as an entity type.

ER-Diagram Representations

Entity types and attributes are essential aspects of database design.

How can we represent them in ER-Diagrams?

We can represent the entity type by a rectangular box filled with its name in it.

The image below shows how to represent the employee, department, and project entity types.

Definitions of Entity Attribute and Entity Type
Definitions of Entity Attribute and Entity Type

How can we represent the attributes?

We can represent the attributes in oval shapes connected to their corresponding entity types.

The image below is the representation of attributes.

Definitions of Entity Attribute and Entity Type Atributes
Definitions of Entity Attribute and Entity Type Attributes