Entity Relationship (ER) Model

The Entity Relationship (ER) Model is a high-level conceptual data model used to represent real-world objects and their relationships in a database. It is mainly used during database design.

1. What is ER Model?

The ER Model describes the logical structure of a database using entities, attributes, and relationships. It helps database designers visualize data before implementation.

2. Entity

An entity is a real-world object that can be uniquely identified. Each entity represents a table in a database.

[ STUDENT ]

3. Attributes

Attributes describe the properties or characteristics of an entity.

[ STUDENT ]
   |
   |-- Roll_No
   |-- Name
   |-- Marks

4. Types of Attributes

4.1 Simple Attribute

Cannot be divided further (e.g., Age).

4.2 Composite Attribute

Can be divided into sub-parts (e.g., Address → Street, City, Pin).

4.3 Single-Valued Attribute

Has only one value (e.g., Roll_No).

4.4 Multi-Valued Attribute

Can have multiple values (e.g., Phone Numbers).

4.5 Derived Attribute

Derived from other attributes (e.g., Age from Date of Birth).

5. Key Attribute

A key attribute uniquely identifies an entity.

[ STUDENT ]
   |
   |-- Roll_No (Primary Key)

6. Relationship

A relationship shows how two or more entities are related.

[ STUDENT ] --- enrolls --- [ COURSE ]

7. Types of Relationships

1:1  → Person ── Passport
1:M  → Teacher ── Students
M:N  → Student ── Course

8. Advantages of ER Model

Practice Questions

  1. What is ER model?
  2. Define entity and attribute.
  3. Explain types of attributes.
  4. What is relationship? Explain its types.
  5. What is key attribute?

Practice Task

Draw an ER diagram for: ✔ Student – Course system ✔ Library management system ✔ Employee – Department system