ER Diagram in DBMS
An ER Diagram (Entity Relationship Diagram) is a graphical representation
of entities, attributes, and relationships in a database.
It is used during the conceptual design phase of database development.
1. What is an ER Diagram?
An ER Diagram visually represents the structure of a database. It helps designers understand data relationships clearly before implementation.
- Graphical representation
- Easy to understand
- Used for database planning
2. ER Diagram Symbols
Rectangle → Entity Ellipse → Attribute Diamond → Relationship Double Ellipse→ Multivalued Attribute Dashed Ellipse→ Derived Attribute Underline → Key Attribute
3. Entity Representation
+-----------+ | STUDENT | +-----------+
Entities are represented using rectangles. Each entity becomes a table in the database.
4. Attribute Representation
(Roll_No)
|
(Name) -- [ STUDENT ] -- (Marks)
- Ellipses represent attributes
- Key attributes are underlined
5. Relationship Representation
[ STUDENT ] -- â—‡Enrollsâ—‡ -- [ COURSE ]
Relationships are represented using diamonds and show how entities are connected.
6. Cardinality Constraints
- One-to-One (1:1)
- One-to-Many (1:M)
- Many-to-Many (M:N)
1:1 → Person ── Passport 1:M → Teacher ── Students M:N → Student ── Course
7. Participation Constraints
Participation constraints specify whether an entity participates partially or totally in a relationship.
- Total Participation → Double line
- Partial Participation → Single line
8. Example ER Diagram
(Roll_No)
|
(Name) |
\ |
[ STUDENT ] ---- Enrolls ---- [ COURSE ]
| |
(CourseID) (CourseName)
9. Advantages of ER Diagrams
- Easy visualization of database structure
- Helps identify relationships clearly
- Reduces design errors
- Easy conversion to relational schema
Practice Questions
- What is an ER diagram?
- List symbols used in ER diagrams.
- Explain cardinality constraints.
- What are participation constraints?
- Draw an ER diagram for Student–Course system.
Practice Task
Draw neat ER diagrams for:
✔ Library Management System
✔ Hospital Management System
✔ Employee–Department System