Topic2 ERModel 5.6.2021
Topic2 ERModel 5.6.2021
Topic 2 – ER Model
Course Instructor
Santosh K. Vishwakarma
[email protected]
ICE GATE
Database Management System
S/W Design
➢ SDLC
▪ Analysis (what)
▪ Design (how)
▪ Coding (implement)
▪ Testing (verify n validate)
▪ Deployment
▪ Maintenance
➢ UML model used for software design (Diagrammatic approach of s/w design)
Database Management System
DB Design
➢ Schema refinement
➢ check each table for insert delete & update anomalies
➢ decomposing the table
➢ Attributes
➢ Relationships
➢ Mapping Cardinality
➢ Participation Constraints
Database Management System
Entity
Salary
ID DOJ
Employee
Database Management System
Strong Entity
➢ Some entity sets in real world naturally depend on some other entity set
➢ They can be uniquely identified only if combined with another entity set
➢ Double rectangles for weak entity set
➢ Example:
➢ section1, section2, … become unique only if you put them into a context, e.g. semester
➢ semester 1, semester 2 ….. become unique only if you put them into a context, e.g.
branch
Database Management System
Attribute
➢ Descriptive
Database Management System
Types of Attributes
Database Management System
Relationship
➢ Relationship – specify the relations among entities from two or more entity sets
• Sometimes entities in a entity set may relate to other entities in the same set. Thus self relationship
• Here employees mange some other employees
• The labels “manger” and “worker” are called roles the self relationship
Database Management System
Types of Relationship - Binary
➢ Mapping Cardinality
➢ Participation Constraints
Database Management System
Relationship Constraints
➢ Mapping Cardinality
Database Management System
Mapping Cardinality
Database Management System
Mapping Cardinality
Database Management System
Mapping Cardinality
Database Management System
Relationship Constraints
➢ Participation Constraints
➢ Total: when we require all entities to participate in the relationship
➢ double lines to specify
➢ Partial: Not all entities require to participate
Example 1
Example 1
Example 1
Example 1
Remarks
Notations
Database Management System
Notations
Database Management System
Tools
Research Paper “Data Modeling in the Cloud” Author: Nenad Jukic et al.
ERD Plus – ER Diagram Example
Generate Relational Schema From ERD
Generate SQL From Relational Schema
Database Management System
GATE QUESTIONS
Database Management System
ER Model
Database Management System
ER Model
Database Management System
ER Model
Database Management System
ER Model
Database Management System
ER Model
Q5. E1 and E2 are two entities and R1, R2 are two relationship between E1 and E2 .
R1 is one to many and R2 is many to many. R1 and R2 dose not have any attribute their
own What is the minimum number of table needed. ? [GATE 2005]
Database Management System
ER Model
Extended ER-Model
• Specialization
• Generalization
• Attribute Inheritance
• Aggregation
Database Management System
Extended ER-Model
• Specialization
• Generalization
• Attribute Inheritance
• Aggregation
Database Management System
Extended ER-Model
• Specialization
• A lower-level entity set inherits all the attributes and relationship participation of
the higher-level entity set to which it is linked.
• A lower-level entity set may have additional attributes and participate in
additional relationships
Database Management System
Extended ER-Model
Database Management System
EERD Example
Database Management System
Translating ER Diagrams into Class Hierarchies
Database Management System
Aggregation
Database Management System
ER Model