Entity in ER Model

The entity is any physical object, which may be a human, place, thing, or any event, i.e., student, chair, Lahore, etc. Each entity contains some attributes, i.e., student entity attributes are roll no, Student_name, etc.

Keep in mind,

  • Entity Set is a set of the same type of entities
  • The structure of an entity with its attributes is known as schema.
  • Entity type tells the information about that entity

Let’s understand the terms entity, entity type, entity set, and schema through the following diagram

Note: Roll_No, Student_Name, Student_age, Student_City are the attributes of Entity Type(Student).

Types of Entities in ER Model

Following is the list of entities in the ER model

Entity in ER Model - all types          

Let’s explain each type in detail

1. Strong Entity

A Strong Entity is an entity that:

  • Exists independently in the database. It does not rely on any other entity for its existence.
  • Always has a Primary Key that uniquely identifies each record (row) in its table. The Primary Key is the main attribute (or set of attributes) used to distinguish one record from another.

Example: Student Table

In the following table each student entity is the strong entity because it can be uniquely identified by Student_ID.

  • A single student with → (Student_ID = 101, Name = Ali, Age = 20, Dept = CS)

Entity in ER Model - Strong Entity

Strong Entity Notation in ER Model:

In an ER (Entity-Relationship) Model, a Strong Entity is represented by a single rectangle.

Entity in ER Model - Strong Entity Notation

In the above diagram, the student is an entity, and Student_ID, Name, Age, and Dept are the attributes.

2. Weak Entity

  • Refers to a single real-world object (record) that cannot be uniquely identified by its own attributes alone.
  • It is dependent on a Strong Entity for its identification.
  • Identified by Partial Key + Primary Key of Strong Entity.

Example: Student and Exam_Result Table

Entity in ER Model - Weak Entity - Problem

  • Problem: Dependent_Name is not unique (many employees can have a dependent named “Ali”).

Solution: How strong entity and weak entity work together is given below

Entity in ER Model - Weak Entity Solution

  • Emp_ID (from Employee = Strong Entity) + Subject_Name (partial key), together, uniquely identify the weak entity.

Important: If Partial Key + Strong Entity’s Primary Key still cannot uniquely identify a weak entity tuple, add an extra distinguishing attribute (e.g., marks, etc.).

  • Use a composite key including this extra attribute for uniqueness.
  • Alternatively, introduce a surrogate key (auto-generated ID) for the weak entity.

Weak Entity Notation in ER Model:

In an ER (Entity-Relationship) Model, a Weak Entity is represented by a double rectangle. In the following diagram, Exam_Result is the weak entity.

   Weak Entity Notation in ER Model

3. Entity Set

An Entity Set is simply a collection of similar entities that share the same attributes in a database.

  • Each entity is one instance (or record) in the set.
  • An entity set is like a table in a relational database.
  • The attributes of the entity set define what information is stored for each entity.

Example: Student Entity Set (Strong entity set)

Entity in ER Model - Entity Set

  • Entity Set Name: Student
  • Attributes: Student_ID, Name, Age, Department
  • Entity set contains all individual records:
    • Student 1 → (101, Ali, 20, CS)
    • Student 2 → (102, Ahmad, 21, Media)
    • Student 3 → (103, Ali, 19, Ecnomics)

Note:

  • A Similar concept will be used for the weak entity set 
  • No specific notations are used for the entity set

4. Associative Entity (Bridge Entity / Intersection Entity)

An Associative Entity is an entity that is created to represent a relationship between two other entities. It is mainly used to resolve Many-to-Many (M:N) relationships in ER modeling. Instead of directly linking two entities with an M:N relationship, we create a new entity (bridge) that connects them.

  • Contains the primary keys of the related entities as foreign keys.
  • Its composite key (combination of foreign keys) uniquely identifies each record.
  • Add additional attributes describing the relationship (e.g., Grade, Date).
  • Represented as a separate table in relational databases (bridge table).

Example: Three tables are required to explain 

  • Student Table
  • Course Table
  • Enrollment Table (Associative Entity)

The following diagram explains the concept in detail

Entity in ER Model - Associative Entity

Explanation

  • Student_ID in Enrollment → points to the Student table.
  • Course_ID in Enrollment → points to Course table.
  • Together, they form a composite primary key (no duplicate enrollment).
  • Extra attributes like Semester, Enrollment_Date, and Grade describe the relationship.

Associative Entity Notation in ER Model:

Represented by a rectangle inside a diamond (or sometimes just a rectangle with rounded corners).

ER Model - Associative Entity Notation

Explaination: Student{1}–{1..n}Enrollment{1..n}–{1}Course

A Student can enroll in many Courses. A Course can have many Students. Enrollment is the link between them, often storing extra details like grade or semester.

  • Student {1} — {1..n} Enrollment

    • One Student can have many Enrollment records (because a student can enroll in multiple courses).

    • But each Enrollment record belongs to exactly one Student.

  • Enrollment {1..n} — {1} Course

    • One Course can appear in many Enrollment records (because many students can enroll in the same course).

    • But each Enrollment record belongs to exactly one Course.

5. Recursive Entity

A Recursive Entity is an entity that has a relationship with itself. It means that records of the same entity set are related to each other.

  • This usually happens when one role of an entity relates to another role of the same entity. Represented in ER diagrams as a looped relationship from the entity back to itself.

Example:  Employee Entity

  • Attributes: Emp_ID, Name, Designation
  • Recursive Relationship: An Employee can be a Manager of another Employee in the same entity set

Entity in ER Model - Recursive Entity

Here, Manager_ID is a foreign key referencing Emp_ID in the same table.

Best practice: Keep Manager_ID nullable so that top-level employees (like CEO or department heads) can have NULL.

Recursive Entity Notation in ER Model:

Represented by a single rectangle (normal entity) with a relationship diamond connecting back to the same entity at both ends.

ER Model - Recursive Entity Notation

6. Super and Sub Entities

A Super Entity is a generalized entity in an ER model that represents the common features or attributes shared by two or more specialized entities (called Sub-Entities).

Instead of repeating the same attributes in multiple entities, those shared attributes are placed in a Super Entity, while the unique attributes of each specialized entity remain in their own Sub-Entities.

Key Points

  • Avoids Duplication → Shared attributes are stored only once in the Super Entity.
  • Parent-Child Relationship → The Super Entity is like a parent, and Sub-Entities are its children.
  • Forms “Is-A Relationship” → Each Sub-Entity is a type of Super Entity.
  • Inheritance → Automatically takes common attributes from the Super Entity.

Note: Super–sub entities (Overlapping Sub-Entities) is a case of Specialization in DBMS.

Example

Suppose we have two entities: Student and Teacher.

  • Both have common attributes: Name, Email, Phone, and DOB.
  • But they also have unique attributes:
    • Student → Roll_No, Course
    • Teacher → Employee_ID, Salary

Instead of repeating Name, Email, Phone, and DOB in both entities, we create a Super Entity:In this way, both Student and Teacher inherit the common attributes from the Super Entity Person. The following figure shows the detail 

Entity in ER Model - Super-Sub Entity

Explanation

A case when a person (e.g., doing a PhD while also teaching as a Lecturer) can belong to both sub-entities at once and contains some common attributes as well.

  • Ali (Person_ID = S_101) is both in the Student and Teacher tables → meaning he is a Student (PhD-Math) and also a Teacher (earning 100,000).

  • Sabir (Person_ID = S_103) is only in the Student table → meaning she is only a student.

Super and Sub Entity Notation in ER Model:

A triangle (ISA symbol) is used to connect the super entity with its sub-entities.

ER Model - Super-Sub Entity Notation

7. Disjoint Sub Entities

Disjoint entities (in specialization) mean that a super-entity instance can belong to only ONE sub-entity at a time.

  • Constraint: If an entity is in one sub-entity, it cannot appear in another sub-entity.
  • Notation in ERD: Represented with a circle connecting sub-entities with a disjoint (d) constraint.

Example 01:

Person, studend and teacher table relation is shown in the folloiwng diagram where

  • Super Entity → Person
  • Sub-Entities → Student, Teacher
  • A single person cannot be both a Student and a Teacher.

Here, each person record must belong to only one subtype: either Student or Teacher.

Entity in ER Model - Disjoint Sub Entity

Example:02

  • Super Entity → Vehicle
  • Sub-Entities → Car or Bike
  • A single vehicle cannot be both a car and a bike.
 

Here, each Vehicle record must belong to only one subtype: either Car or Bike.

Super Entity: Vehicle

Vehicle_ID Vehicle_Type
V1 Car
V2 Bike
V3 Car

Sub-Entity: Car

Vehicle_ID Car_Model Fuel_Type
V1 Corolla Petrol
V3 Civic Diesel

Sub-Entity: Bike

Vehicle_ID Bike_Model Engine_CC
V2 Yamaha R15 150cc

 Notice:

  • V1 and V3 are Cars only
  • V2 is a Bike only
  • No vehicle appears in both tables → Disjoint.

Disjoint Sub Entity Notation in ER Model: Exactly similar to Super and Sub Entity Notation in ER Model

8. Overlapping Sub Entities

In Overlapping Specialization, an entity in the super-entity can belong to more than one sub-entity at the same time.

It is still a specialization (Super–Sub relationship), but unlike Disjoint, the same entity can appear in multiple sub-entities.

Example:

  • Super Entity: Person
  • Sub-Entities: Student, Teacher

In overlapping specialization, a Person can be a Student, a Teacher, or both at the same time.

Entity in ER Model - Overlapping Sub Entity

Explanation:

  • Ali (Person_ID = S_101) → in both Student & Teacher → a PhD Student (Math) and also a Teacher (Salary 100,000).
  • Ahmas (Person_ID = S_102) → in both Student & Teacher → a PhD Student (Physics) and also a Teacher (Salary 200,000).
  • Sabir (Person_ID = S_103) → only in Student → a Student only.

 This shows Overlapping Sub-Entities (specialization case).

Overlapping Sub Entity Notation in ER Model: Exactly similar to Super and Sub Entity Notation in ER Model

 

Relationship between a strong and weak entity

The relation between one strong and one weak entity is represented by a double diamond symbol.

As Loan must be taken by some customer. So, the loan fully participates in relation. And not every customer acquires the loan. so the customer is partially participating in relation.