The Entity–Relationship (ER) Model is a high-level data modeling technique used in software engineering and database design.
It provides a way to visually represent the entities (objects), attributes (properties), and relationships (connections) in a system.
It was introduced by Peter Chen in 19...
The Entity–Relationship (ER) Model is a high-level data modeling technique used in software engineering and database design.
It provides a way to visually represent the entities (objects), attributes (properties), and relationships (connections) in a system.
It was introduced by Peter Chen in 1976 and is widely used to design relational databases before implementing them in DBMS.
Size: 642.9 KB
Language: en
Added: Oct 08, 2025
Slides: 26 pages
Slide Content
UML ER Diagram
Prepared by:
Asst. Prof. Nikul Zinzuvadiya
Introduction
The Entity–Relationship (ER) Model is a high-level data modeling technique used in software
engineering and database design.
It provides a way to visually represent the entities (objects), attributes (properties), and relationships
(connections) in a system.
It was introduced by Peter Chen in 1976 and is widely used to design relational databases before
implementing them in DBMS.
Key Components of ER Model
1.Entity
●An object or "thing" in the real world that has a distinct existence in the system.
●Example: Student, Course, Teacher.
●Representation: Rectangle in ER diagrams.
2.Attribute
●The properties that describe an entity.
●Example: StudentID, Name, Email, CourseName.
●Representation: Oval/Ellipse connected to an entity.
●Types of Attributes:
○Simple Attribute: Cannot be divided (e.g., Name).
○Composite Attribute: Can be split (e.g., FullName → FirstName + LastName ).
○Derived Attribute: Computed from others (e.g., Age from DOB).
○Multi-valued Attribute: Can have multiple values (e.g., PhoneNumbers).
3.Relationship
●A connection between two or more entities.
●Example: "Student enrolls in Course" .
●Representation: Diamond in ER diagrams.
●Types of Relationships:
○One-to-One (1:1) → A student has one ID card.
○One-to-Many (1:N) → A teacher teaches many courses.
○Many-to-One (N:1): Many students belong to one department.
○Many-to-Many (M:N) → Students enroll in many courses, and each course has many
students.
Symbols Used in ER Model
What is an Entity?
●An Entity = a real-world object, concept, or thing about which we store data in a database.
●Acts as a building block of a database.
●In Relational Databases, an Entity → Table.
●An Entity Instance → Row in that table.
Examples of Entities:
●Real-World Objects: Person, Car, Employee
●Concepts: Course, Event, Reservation
●Things: Product, Document, Device
What is an Entity Set?
●An Entity Set = collection of all similar entities of one type.
●Example:
○One student = Entity.
○All students = Entity Set.
●In ER Diagram → Entities are shown as rectangles.
⚡ Note:
●ER Diagram shows Entity Sets, not individual entities.
●Because an Entity Set = Table, while an Entity = Row inside that table.
Types of Entities
1. Strong Entity
●Can be uniquely identified using its own primary key.
●Does not depend on any other entity.
●ER Diagram Symbol: Single Rectangle.
●✅ Example: Employee (EmployeeID identifies each employee).
2. Weak Entity
●Cannot be uniquely identified by its own attributes.
●Depends on a Strong Entity for identification.
●Always has total participation with its parent (strong entity).
●ER Diagram Symbol: Double Rectangle.
●Relationship = Identifying Relationship (Double Diamond).
●Example: Dependent (spouse/child of Employee).
○Dependent alone cannot be identified uniquely.
○Needs EmployeeID + DependentName to be unique.
What is an Attributes?
Attributes are the properties/characteristics that describe an Entity Type.
●Example: For a Student Entity → Roll_No, Name, DOB, Age, Address, Mobile_No .
●In ER Diagram: Attributes are shown as ovals (ellipses) connected to entities.
Types of Attributes
1. Key Attribute
●Uniquely identifies each entity.
●Example: Roll_No for each student.
●ER Symbol: Oval with underline.
2. Composite Attribute
●An attribute made up of smaller
sub-attributes.
●Example: Address → Street,
City, State, Country.
●ER Symbol: Oval connected with
smaller ovals.
3. Multivalued Attribute
●Attribute that can have multiple values for one entity.
●Example: Phone_No (a student can have more than one number).
●ER Symbol: Double oval.
4. Derived Attribute
●Attribute that can be calculated/derived from another attribute.
●Example: Age (calculated from DOB).
●ER Symbol: Dashed oval.
The Complete Entity Type Student with its Attributes can be represented as:
Relationship Type and Relationship Set
1. Relationship Type
●Shows the general connection between two entity types.
●In ER Diagram: Represented by a diamond with lines connecting entities.
Example:
●Entities: Student and Course
●Relationship Type: Enrolled in
●Meaning: Students are enrolled in Courses.
2. Relationship Set
●A collection of actual instances (real examples) of a relationship type.
●It is like the rows of data in a table that record which specific students enrolled in which specific
courses.
Example:
●S1 is enrolled in C2
●S2 is enrolled in C1
●S3 is enrolled in C3
Together, these pairs form the
Relationship Set.
Degree of a Relationship Set
The degree of a relationship set = the number of different entity sets participating in that relationship.
1⃣ Unary / Recursive Relationship (Degree 1)
●Only one entity set participates in the relationship.
●The entity relates to itself.
●Example: A Person is married to another Person.
2⃣ Binary Relationship (Degree 2)
●Two entity sets participate in the relationship.
●Most common type in databases.
●Example: A Student is enrolled in a Course.
3⃣ Ternary Relationship (Degree 3)
●Three entity sets participate in the relationship.
●Example: A Doctor prescribes a Medicine to a Patient.
4⃣ N-ary Relationship (Degree n)
●More than three entity sets participate in the relationship.
●Example: A project may involve Employee, Department, Location, etc.
Cardinality in ER Model
Cardinality = The maximum number of times an entity from one set can participate in a relationship
with entities from another set.
1⃣ One-to-One (1:1)
●Each entity in Set A is related to only one entity in Set B, and vice versa.
●Example: A surgeon is headed by one HOD, and one HOD heads only one surgeon.
2⃣ One-to-Many (1:M)
●One entity in Set A is related to many entities in Set B, but each entity in Set B is related to only
one in Set A.
●Example: One surgeon department has many doctors, but each doctor belongs to only one
department.
3⃣ Many-to-One (M:1)
●Many entities in Set A are related to one entity in Set B.
●Example: Many surgeries are done by one surgeon.
4⃣ Many-to-Many (M:N)
●Entities in Set A can be related to many in Set B, and vice versa.
●Example: Many employees work on many projects, and each project can have many employees.
Participation Constraint
Participation Constraint tells us whether all or only some entities in an entity set take part in a
relationship.
1⃣ Total Participation
●All entities in the entity set must participate in the relationship.
●Shown by double line in ER diagram.
●Example: If every student must enroll in at least one course, then Student → Course is Total
Participation.
2⃣ Partial Participation
●Some entities in the entity set may not participate in the relationship.
●Shown by single line in ER diagram.
●Example: Some courses may not be taken by any student. So Course → Student is Partial
Participation.
How to Draw an ER Diagram
1. Identify Entities: The very first step is to identify all the Entities. Represent these entities in a
Rectangle and label them accordingly.
2. Identify Relationships: The next step is to identify the relationship between them and represent them
accordingly using the Diamond shape. Ensure that relationships are not directly connected to each other.
3. Add Attributes: Attach attributes to the entities by using ovals. Each entity can have multiple attributes
(such as name, age, etc.), which are connected to the respective entity.
4. Define Primary Keys: Assign primary keys to each entity. These are unique identifiers that help
distinguish each instance of the entity. Represent them with underlined attributes.
5. Remove Redundancies: Review the diagram and eliminate unnecessary or repetitive entities and
relationships.
6. Review for Clarity: Review the diagram make sure it is clear and effectively conveys the relationships
between the entities.
Ex: ER Diagram for a Company/Employee Management System .