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.

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)

5. Relationship Representation

[ STUDENT ] -- â—‡Enrollsâ—‡ -- [ COURSE ]

Relationships are represented using diamonds and show how entities are connected.

6. Cardinality Constraints

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.

8. Example ER Diagram

           (Roll_No)
               |
        (Name)  |
           \    |
          [ STUDENT ] ---- Enrolls ---- [ COURSE ]
                               |          |
                          (CourseID)   (CourseName)

9. Advantages of ER Diagrams

Practice Questions

  1. What is an ER diagram?
  2. List symbols used in ER diagrams.
  3. Explain cardinality constraints.
  4. What are participation constraints?
  5. Draw an ER diagram for Student–Course system.

Practice Task

Draw neat ER diagrams for: ✔ Library Management System ✔ Hospital Management System ✔ Employee–Department System