Skip to content

ER Model - DBMS

Understanding how data in the real world can be represented in a structured and meaningful way is a core part of database design. The Entity-Relationship (ER) Model helps us visually map real-world objects (called entities), their characteristics (attributes), and how they relate to one another (relationships). This model acts as the blueprint for designing databases that are both logical and efficient.


  • A data model is a set of tools or concepts used to describe:

    • What kind of data is stored
    • How data items relate to each other
    • Rules that must be followed (like constraints)
  • It helps in designing and understanding a database.

Example: Think of it like a blueprint before building a house.


  • The Entity-Relationship (ER) model is a way to visually represent how data is related in the real world.

    ER Model
  • It focuses on:

    • Entities (objects like Student, Car)
    • Relationships between them (like Student enrolls in Course)
  • It uses a diagram called the ER Diagram, which is like the database’s sketch or plan.


ER Notations

  • An entity is a real-world object you can identify uniquely.
  • It can be a person, place, thing, or event.

Examples:

  • A student in your class
  • A car registered in your name
TypeMeaningExample
StrongHas a unique identity (Primary Key)Student with ID
WeakCannot exist alone; needs another onePayment needs Loan to exist

  • A group of similar entities is called an Entity Set.

Examples:

  • All students in a school → Student Entity Set
  • All customers of a bank → Customer Entity Set

  • Attributes are the details or characteristics of an entity.

For a Student:

  • Attributes = Student_ID, Name, Class, Phone Number, Address
TypeDescriptionExample
SimpleCannot be split furtherRoll Number
CompositeCan be split into partsName → First, Middle, Last
Single-valuedOne value onlyStudent_ID
Multi-valuedMore than one valuePhone Numbers
Derived Can be calculatedAge (from Date of Birth)
NullValue is missing or not applicableMiddle name (if not present)
Types of Attributes

  • A relationship connects two or more entities together.

Examples:

  • Student enrolls in Course
  • Customer borrows Loan
TypeDescriptionExample
StrongBetween independent entitiesStudent - Course
WeakInvolves weak entity (needs strong one)Loan - Payment
Types of Relationships
DegreeMeaningExample
UnaryOne entity involvedEmployee manages Employee
BinaryTwo entitiesStudent takes Course
TernaryThree entitiesEmployee works-on Project at Branch

These define how many entities can participate in a relationship.

TypeMeaningExample
One-to-OneA to B = 1:1Person has one Aadhar Card
One-to-ManyA to many BCitizen has many Vehicles
Many-to-OneMany A to one BStudents enrolled in one College
Many-to-ManyMany A to many BStudents attend many Courses

B. Participation Constraints (Is It Optional or Mandatory?)

Section titled “B. Participation Constraints (Is It Optional or Mandatory?)”
TypeDescriptionExample
PartialOnly some entities participateCustomer may or may not take a Loan
TotalAll entities must participateEvery Loan must belong to a Customer

ER Features can be used to model most DB features but when complexity increases, it is better to use some Extended ER features to model the DB Schema.

  • In ER model, we may require to subgroup an entity set into other entity sets that are distinct in some way with other entity sets.
  • Specialisation is splitting up the entity set into further sub entity sets on the basis of their functionalities, specialities and features.
  • It is a Top-Down approach.
  • e.g., Person entity set can be divided into customer, student, employee. Person is superclass and other specialised entity sets are subclasses.
    • We have “is-a” relationship between superclass and subclass.
    • Depicted by triangle component.
  • Certain attributes may only be applicable to a few entities of the parent entity set.
  • DB designer can show the distinctive features of the sub entities.
  • To group such entities we apply Specialisation, to overall refine the DB blueprint.
  • It is just a reverse of Specialisation.
  • DB Designer, may encounter certain properties of two entities are overlapping. Designer may consider to make a new generalised entity set. That generalised entity set will be a super class.
  • “is-a” relationship is present between subclass and super class.
  • e.g., Car, Jeep and Bus all have some common attributes, to avoid data repetition for the common attributes. DB designer may consider to Generalise to a new entity set “Vehicle”.
  • It is a Bottom-up approach.
  • Makes DB more refined and simpler.
  • Common attributes are not repeated.
  • Both Specialisation and Generalisation, has attribute inheritance.
  • The attributes of higher level entity sets are inherited by lower level entity sets.
  • E.g., Customer & Employee inherit the attributes of Person.

If a parent entity set participates in a relationship then its child entity sets will also participate in that relationship.

  • Aggregation is the technique to show relationship among relationships
  • Abstraction is applied to treat relationships as higher-level entities. We can call it Abstract entity.
  • Avoid redundancy by aggregating relationship as an entity set itself.