An ER Diagram (Entity Relationship Diagram) is a graphical representation of the Entity Relationship Model. It shows entities, their attributes, and the relationships between them using standard symbols. ER Diagrams are used during the database design phase to visualize how data will be organized and how different pieces of data are connected.

For beginners, ER diagrams act as a “blueprint” of the database that can later be converted into relational tables, keys, and SQL code.

1. Symbols in ER Diagram

a) Entity

  • Represented as a rectangle.

  • The name of the entity type is written inside the rectangle (for example, STUDENT, COURSE).

  • Each rectangle corresponds to an entity type, not a single record.

b) Attribute

  • Represented as an oval connected to the entity.

  • Key attributes (that uniquely identify an entity) are often underlined.

  • Sometimes attributes are simply listed inside the entity rectangle.

Example:

  • For STUDENT, attributes like Roll_No, Name, Branch, CGPA are shown connected to the STUDENT rectangle.

c) Relationship

  • Represented as a diamond (or sometimes just a connecting line).

  • The name of the relationship is written inside the diamond.

  • Relationships connect two or more entities.

Example:

  • STUDENT and COURSE may be connected by a diamond labeled ENROLLS_IN.

d) Cardinality and Participation

Cardinality and participation are written near the lines connecting entities and relationships.

  • Cardinality:

    • 1:1, 1:M, or M:N written near the respective ends.

  • Participation:

    • Total participation is often shown with a double line from the entity to the relationship.

    • Partial participation is shown with a single line.

Some notations use crow’s foot style (lines with “ticks” or “forks”) to indicate cardinality.

2. Steps to Draw an ER Diagram

Step 1: Identify Entities

  • Read the requirements and list important objects.

  • Common examples: STUDENT, COURSE, DEPARTMENT, EMPLOYEE, PRODUCT.

Step 2: Identify Attributes

  • For each entity, decide its attributes.

  • Decide which attribute (or combination) is the key.

  • Underline or mark the key attribute.

Step 3: Identify Relationships

  • Decide how entities are related.

  • For example, STUDENT → ENROLLS_IN → COURSE, or EMPLOYEE → WORKS_IN → DEPARTMENT.

Step 4: Add Cardinality and Participation

  • For each relationship, decide:

    • How many students can enroll in a course?

    • Does every employee belong to a department?

  • Write cardinality (1:1, 1:M, M:N) and draw appropriate lines (single or double).

Step 5: Add Any Special Constraints

  • Multi‑valued attributes, composite attributes, weak entities, and so on.

  • These can be shown with special symbols or notes around the main diagram.

3. Example ER Diagram

Consider a college database with:

  • STUDENT (Roll_No, Name, Branch)

  • COURSE (Course_ID, Course_Name, Credits)

  • ENROLLS_IN (relationship between STUDENT and COURSE)

In an ER diagram:

  • STUDENT and COURSE are rectangles.

  • ENROLLS_IN is a diamond connecting them.

  • Cardinality is M:N because one student can enroll in many courses and one course can have many students.

  • Participation:

    • A student may or may not be enrolled in any course today (partial participation).

    • A course may or may not have any enrolled students yet (partial participation).

In notation:

  • STUDENT → (1;M) ENROLLS_IN → (1;N) COURSE

Such a diagram clearly shows the structure of the database before any SQL is written.

4. Why ER Diagrams Are Important?

  • They help communicate the design between developers, DBAs, and stakeholders.

  • They prevent design errors by making relationships and constraints visible.

  • They are the first step toward converting the design into relational tables.

  • They make it easier to discuss and refine requirements before implementation.

5. Common Notations

Different textbooks and tools use slightly different styles, but the core ideas are the same. Two popular styles are:

  • Rectangle–Diamond–Oval style (basic ER notation).

  • Crow’s foot notation (used in many database tools and CASE tools).

You do not need to memorize every style; understanding the meaning of entities, attributes, relationships, cardinality, and participation is more important.

Summary

An ER Diagram in DBMS is a visual representation that uses rectangles for entities, ovals for attributes, diamonds for relationships, and special marks for cardinality and participation. It is a powerful beginner‑friendly tool for designing databases and serves as the bridge between business requirements and the relational model.