ER Model in DBMS
Entities, Attributes & Relationships
Entity-Relationship Model · Strong & Weak Entities · Simple, Composite, Derived, Multivalued Attributes · Cardinality · Generalization · Specialization · Aggregation · ER Diagram Symbols · Banking Examples · 45 MCQs — GATE, IBPS, SSC, UPSC
Foundation — High Weight in GATE & IBPSWhat is the ER Model?
The Entity-Relationship (ER) Model is a conceptual data model — a high-level blueprint for designing a database. It visually represents the data structure of a system using three core elements: Entities (things), Attributes (properties), and Relationships (links). Proposed by Peter Chen in 1976.
- ER Model = conceptual/logical design tool — not physical implementation
- Used before actual database creation — as a blueprint
- ER diagrams are later converted to relational tables (normalisation)
- Memory mnemonic: EAR = Entities + Attributes + Relationships
- Proposed by: Peter Chen, 1976
- Primary purpose: communicate database design to stakeholders before coding
Most Tested in Exams — Know All ShapesER Diagram Symbols
Rectangle
Represents an entity that exists independently with its own primary key
Double Rectangle
Entity that depends on a strong entity for existence. Has no primary key alone
Oval
Represents a property or characteristic of an entity or relationship
Dashed Oval
Attribute calculated from another stored attribute — not directly stored
Double Oval
Attribute that can hold multiple values for a single entity
Diamond ♦
Represents a relationship between two or more entities
Double Diamond
Relationship that links a weak entity to its owner/identifying strong entity
Underlined Oval
Attribute that uniquely identifies each entity instance (primary key)
Single / Double Line
Single line = partial participation. Double line = total participation (mandatory)
- Rectangle = Strong Entity | Double Rectangle = Weak Entity
- Oval = Attribute | Dashed Oval = Derived Attribute | Double Oval = Multivalued
- Underlined Oval = Key Attribute (Primary Key)
- Diamond = Relationship | Double Diamond = Identifying Relationship (weak entity)
- Single line = Partial participation | Double line = Total participation
Two Types — Both Exam FavouritesEntities — Strong & Weak
An Entity is any real-world object or concept that has data stored about it and can be uniquely identified. Represented by a rectangle in ER diagrams.
□ Strong Entity
Rectangle — Single borderAn entity that exists independently — it has its own primary key to uniquely identify each instance. Does not depend on any other entity for its existence.
▣ Weak Entity
Double Rectangle — Double borderAn entity that cannot exist without a strong entity. Has no primary key of its own — identified using a partial key + foreign key of the owner (strong) entity. Its relationship with the owner is called an identifying relationship (double diamond).
| Feature | Strong Entity | Weak Entity |
|---|---|---|
| Existence | Independent | Depends on strong entity |
| Primary Key | Has its own PK | No PK — uses partial key + owner FK |
| Partial Key | Not applicable | Has discriminator (partial key) — underlined with dashed underline |
| Symbol | Single Rectangle | Double Rectangle |
| Relationship | Regular diamond | Identifying relationship = Double Diamond |
| Participation | Partial or Total | Always Total (mandatory) |
| Banking example | Customer, Account, Branch | Dependent of Employee, EMI of Loan |
5 Types — All Exam FavouritesTypes of Attributes
Simple Attribute
OvalCannot be divided into smaller sub-parts. Atomic single value. The most basic attribute type.
Composite Attribute
Oval with child OvalsCan be divided into smaller meaningful sub-parts. Each sub-part is itself an attribute.
Derived Attribute
Dashed OvalValue is calculated from another stored attribute. Not directly stored in the database — computed on demand.
Multivalued Attribute
Double OvalCan have multiple values for a single entity. Like a list or set of values per entity.
Key Attribute
Underlined OvalUniquely identifies each entity in the entity set. Becomes the primary key when converted to a table.
| Attribute Type | ER Symbol | Can Split? | Stored? | Multi-value? | Banking Example |
|---|---|---|---|---|---|
| Simple | Oval | No | Yes | No | Account_No, Balance |
| Composite | Oval + child Ovals | Yes | Yes (sub-parts) | No | Name → {First, Last} |
| Derived | Dashed Oval | No | No (computed) | No | Age from DOB |
| Multivalued | Double Oval | No | Yes (multiple) | Yes | Phone_Numbers |
| Key | Underlined Oval | No | Yes | No | Customer_ID |
- Derived = dashed oval = computed (Age from DOB) — NOT stored directly
- Multivalued = double oval = multiple values per entity (phone numbers)
- Key attribute = underlined oval = uniquely identifies entity = becomes PK in table
- Composite = can be split into sub-parts (Name → First + Last)
- Simple = cannot be further divided (atomic) — most common type
Diamond Symbol — Very Frequently TestedRelationships
A Relationship describes an association between two or more entities. Represented by a diamond (♦) in ER diagrams. Relationships can have their own attributes (e.g., the date an employee joined a project).
| Term | Meaning | Example |
|---|---|---|
| Degree | Number of entities participating in a relationship | Unary (1), Binary (2), Ternary (3) |
| Unary (degree 1) | An entity related to itself (recursive) | Employee MANAGES Employee |
| Binary (degree 2) | Two entities related — most common | Customer HAS Account |
| Ternary (degree 3) | Three entities related in one relationship | Supplier SUPPLIES Product to Project |
| Cardinality | How many instances of each entity participate | 1:1, 1:N, M:N |
| Relationship attribute | Attribute belonging to the relationship itself | Date_of_Enrollment in ENROLLS relationship |
- Degree = number of entities in a relationship (NOT the same as cardinality)
- Unary/Recursive: Employee manages Employee (same entity type, related to itself)
- Binary = most common type in exams | Ternary = 3 entities
- Relationship can also have attributes — e.g., “Enrollment_Date” in Student ENROLLS Course
- Relationship symbol = Diamond ♦ | Identifying relationship = Double Diamond
1:1, 1:N, M:N — Most AskedCardinality Ratios
1 : 1
Each instance of Entity A is associated with exactly one instance of Entity B, and vice versa. Rarest cardinality type.
1 : N
One instance of Entity A can be associated with many instances of Entity B, but each B is associated with only one A.
M : N
Many instances of Entity A can be associated with many instances of Entity B, and vice versa.
- 1:1 (One-to-One): Passport ↔ Person, Husband ↔ Wife, CEO ↔ Company
- 1:N (One-to-Many): Teacher → Students, Customer → Accounts, Dept → Employees (MOST COMMON)
- M:N (Many-to-Many): Student ↔ Course, Employee ↔ Project, Doctor ↔ Patient
- M:N relationship → needs a junction/associative table when converted to relational schema
- Degree ≠ Cardinality: Degree = number of entity types; Cardinality = how many instances
Total vs Partial — Exam DistinctionParticipation Constraints
Participation constraint specifies whether the existence of an entity depends on its being related to another entity through a relationship.
| Type | Meaning | Symbol | Example |
|---|---|---|---|
| Total Participation | Every entity instance MUST participate in the relationship (mandatory) | Double line (=====) | Every Loan MUST have a Customer; Every employee MUST work in a department |
| Partial Participation | Some entity instances may NOT participate in the relationship (optional) | Single line (——) | Not every Customer has a Loan; Not every Employee manages a project |
- Total = Double line = mandatory — “Every X must be associated with Y”
- Partial = Single line = optional — “Some X may not be associated with Y”
- A weak entity always has total participation in its identifying relationship
- Cardinality + Participation together fully define relationship constraints
Frequently Tested Advanced ConceptsGeneralisation, Specialisation, Aggregation & Participation
Generalisation
Bottom → TopProcess of extracting common features from multiple lower-level entities and creating a higher-level entity. Combines specifics into a general concept.
Savings_Account + Current_Account → Account
Specialisation
Top → BottomProcess of dividing a higher-level entity into lower-level sub-entities based on distinguishing characteristics. Creates more specific types from a general one.
Account → Savings + Current + NRE
Aggregation
Relationship → EntityTreats a relationship (set) as a higher-level entity. Used when a relationship needs to participate in another relationship — abstracting the relationship into an entity.
IS-A Hierarchy
InheritanceLower-level entities inherit attributes of the higher-level entity. Also known as IS-A relationship. Supports attribute and relationship inheritance.
| Concept | Direction | Memory Hook | Example |
|---|---|---|---|
| Generalisation | Bottom → Top (upward) | “Combine many → one general” | Car + Truck → Vehicle |
| Specialisation | Top → Bottom (downward) | “Split one → many specific” | Employee → Manager + Engineer |
| Aggregation | Relationship → becomes Entity | “Relationship treated as entity” | Project-Employee → Manager oversees |
| IS-A | Subtype ← Supertype | “Subclass inherits superclass” | Manager IS-A Employee |
- Generalisation = bottom-up (combine low-level into high-level)
- Specialisation = top-down (split high-level into sub-entities)
- Aggregation = when a relationship itself must relate to another entity
- Both generalisation and specialisation result in the same ER structure — only the design process differs
- “Vehicle split into Car and Truck” = Specialisation (top-down) | “Car and Truck merged into Vehicle” = Generalisation (bottom-up)
Banking Context — High Exam RelevanceBanking ER Model Examples
| System | Entities | Key Attributes | Relationships | Cardinality |
|---|---|---|---|---|
| Core Banking | Customer, Account, Branch, Transaction | Customer_ID, Account_No, IFSC_Code, Txn_ID | HAS (Customer-Account), PERFORMED_AT (Account-Branch), RECORDS (Account-Transaction) | 1:N, M:N, 1:N |
| Loan System | Customer, Loan, Branch, EMI (weak) | Customer_ID, Loan_No, Branch_Code, EMI_No | APPLIES_FOR (Customer-Loan), PROCESSED_AT (Loan-Branch), HAS (Loan-EMI) | M:N, M:1, 1:N |
| Employee HR | Employee, Department, Manager, Dependent (weak) | EmpID, Dept_Code, Dependent_Name | WORKS_IN (Emp-Dept), MANAGES (Emp-Emp), HAS_DEPENDENT (Emp-Dependent) | M:1, 1:N, 1:N |
| ATM Network | Customer, Card, ATM_Machine, Transaction | Customer_ID, Card_No, ATM_ID, Txn_ID | HOLDS (Customer-Card), PERFORMS (Card-ATM_Transaction), LOCATED_AT (ATM-Branch) | 1:1, M:N, M:1 |
Design ProcessSteps to Draw an ER Diagram
Identify Entities
Look for nouns in the requirements — these are candidate entities
List Attributes
For each entity, identify its properties. Mark the key attribute (underline)
Find Relationships
Look for verbs — MANAGES, HAS, ENROLLS, WORKS_FOR
Set Cardinality
Determine 1:1, 1:N, or M:N for each relationship
Draw with Symbols
Use rectangles, ovals, diamonds, lines with correct notation
Tap Any Option to Reveal AnswerMCQ Practice — 45 Questions (4 Chapters)
Last-Minute PrepQuick Revision Flash Cards
🗺️ ER Model Basics
- ER Model = conceptual blueprint for DB design
- Proposed by Peter Chen, 1976
- 3 elements: EAR = Entities + Attributes + Relationships
- Used BEFORE actual DB creation
🔷 ER Symbols
- Rectangle = Entity (strong)
- Double Rectangle = Weak Entity
- Oval = Attribute
- Dashed Oval = Derived Attribute
- Double Oval = Multivalued
- Underlined Oval = Key Attribute
- Diamond = Relationship
- Double Diamond = Identifying Relationship
📦 Entities
- Strong: independent, has own PK, single rectangle
- Weak: depends on strong entity, no PK alone, double rectangle
- Weak uses partial key + FK of owner
- Weak always has total participation
- Banking: Customer/Account = strong; EMI = weak
🏷️ Attribute Types
- Simple = atomic, oval
- Composite = divisible (Name → First + Last)
- Derived = computed (Age from DOB), dashed oval
- Multivalued = multiple values (Phones), double oval
- Key = unique identifier, underlined oval
⚖️ Cardinality
- 1:1 = Passport ↔ Person
- 1:N = Customer → Accounts (most common)
- M:N = Student ↔ Course
- M:N needs a junction table in relational schema
🎯 Participation
- Total = mandatory = double line (==)
- Partial = optional = single line (—)
- Weak entity always has total participation
🚀 Advanced Concepts
- Generalisation = Bottom-up (Car+Truck → Vehicle)
- Specialisation = Top-down (Employee → Manager+Clerk)
- Aggregation = Relationship becomes Entity
- IS-A = inheritance hierarchy
🏦 Banking ER
- Entities: Customer, Account, Loan, Branch, Employee
- Weak entities: EMI (of Loan), Dependent (of Employee)
- Customer HAS Account = 1:N
- Employee WORKS_IN Branch = M:1
- Customer APPLIES_FOR Loan = M:N
Related notes
More free study notes in Information Technology — all part of the GyanDesk study library.
