SlideShare a Scribd company logo
Database Management System
E-R Data Model
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
Design Phases
2
Physical-design
Phase
[Relational Database]
Logical-design Phase
[Relational Schema]
Conceptual-design
Phase
[ER Diagram]
User
Requirements
Specification
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
Conceptual Design >> E-R Data Model
▸ Entity-relationship(E-R) data model is used to represent the conceptual design. It maps the meanings and interactions of
real-world enterprises onto a conceptual schema.
▸ The E-R data model perceives the real world as consisting of basic objects, called entities, and relationships among these
objects.
▸ The E-R model has an associated diagrammatic representation, the E-R diagram. E-R diagram can express the overall
logical structure of a database graphically.
▸ Three principal concepts:
▪ Entity sets
▪ Attributes
▪ Relationship sets
▸ We will consider Chen Model Notations for our E-R Diagram.
3
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Components
▸ Entity: It is a real-world object about which we collect data. In other words, it is a definable thing that can have data stored
about it.
▸ Entity Set: An entity set is a set of entities of the same type that share the same properties or attributes.
▸ Attributes: Attributes are descriptive properties of the entities in the entity set. Each entity has its own value for each
attribute.
▸ Relationship: It is an association among several entities.
▸ Relationship Set: It is a set of relationships of the same type.
4
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Components
5
Entity
Entity Set
Attribute Relationship
Relationship Set
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Attributes
6
Simple – Attribute value is atomic and can’t be
divided into subparts.
Composite – Attributes that can be divided into
subparts i.e. other attributes.
Derived – Attributes that can be calculated from
other related attributes.
Multivalued – Attributes having more than one
values (a set of values) for a specific entity.
SimpleAttr
address
street
zipCode
city
age
ContactNo
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Relationship Attributes
7
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
One-to-Many Relationship Set Many-to-Many Relationship Set
E-R Diagram >> Relationship Attributes
8
Descriptive Attribute – Properties/characteristics of a relationship.
This type of attributes can’t be associated with any entity sets that the
relationship set links.
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
Superkey – A set of one or more attributes that, taken collectively, allow
us to identify uniquely an entity in the entity set.
Candidate key – A minimal (irreducible) superkey such that no proper
subset of its attributes is also a superkey.
Primary key – The candidate key chosen to be used for identifying entities
and accessing records.
Key attribute – An attribute that is part of a (primary) key.
Partial key/Discriminator – an attribute that when combined with the key
attribute of the owner entity, provides identification for the weak entity.
E-R Diagram >> Keys
9
KeyAttribute
PartialKeyAttr
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
Composite key – A key that is composed of more
than one attribute.
Foreign key – An attribute or combination of
attributes in one table whose values must either
match the primary key in another table or be null.
Foreign keys are used to ensure referential
integrity, the condition in which every foreign key
entry must either be null or a valid value in the
primary key of the related table.
Relational Database Keys
10
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Entity Sets
11
Strong Entity Set – has enough attributes to
uniquely identify each entity.
Weak Entity Set – It is one whose existence is
dependent on another (identifying) entity set.
The primary key attributes of the identifying
entity set, along with the discriminator (partial
key) attributes of its own are used to uniquely
identify each weak entity.
customer
id name street city
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Entity Sets
12
Associative Entity Set – This type of entity set is
used in a many-to-many relationship.
When you need a relationship to be involved in a
relationship then the former relationship is
converted to an associative entity.
course
student
enroll
ment
course
student
enroll
ment
teacher
teach
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Example
13
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Relationship Sets
14
Non-Identifying Relationship Set – A relationship where child entity is
existence-independent of parent entity, and primary key of child doesn’t
contain primary key component of parent entity.
In terms of relationship strength, it is also known as weak relationship.
Identifying Relationship Set – A relationship where child entity is
existence-dependent on parent (identifying) entity, and primary key of
child entity contains primary key component of parent entity.
The identifying relationship set should not have any descriptive
attributes, since any such attributes can instead be associated with the
weak entity set.
In terms of relationship strength, it is also known as strong relationship.
RelSet
Identifying
RelSet
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Relationship Sets
15
Recursive Relationship Set – The same entity set
participates more than once in the relationship.
▪ The function that an entity plays in a
relationship is called that entity’s role.
▪ Since entity sets participating in a relationship
set are generally distinct, roles are implicit and
are not usually specified.
▪ However, they are useful when the meaning of
a relationship needs clarification.
Parallel Relationship Set – more than one
relationships between the same entity sets.
Students Courses
Take
TA
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Mapping Cardinalities
16
One-to-one(1:1) – An entity in A is associated
with at most one entity in B, and an entity in B is
associated with at most one entity in A.
Mapping cardinalities, or Cardinality ratios, express the number of entities to which another entity can be associated via a
relationship set.
department
chairperson
chair-
dept
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Mapping Cardinalities
17
One-to-many (1:N) – An entity in A is associated
with any number of entities in B. An entity in B,
however, can be associated with at most one
entity in A.
class
faculty
faculty
-class
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Mapping Cardinalities
18
Many-to-many (M:N) – An entity in A is
associated with any number of entities in B, and
an entity in B is associated with any number of
entities in A.
class
student enroll
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Participation Constraints
19
Total participation – Every member of the entity
set must participate in the relationship
Partial participation – Not all entities in the set
are involved in the relationship. In the previous
example not every professor guides student.
student
professor guides
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
Extended E-R Diagram >> Generalization
20
Generalization – It is the process of extracting
common properties from a set of entities and
create a generalized entity from it.
It is a bottom-up approach in which tow or more
entities can be generalized to a higher level
entity if they have some attributes in common.
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
Extended E-R Diagram >> Specialization
21
Specialization – an entity is divided into sub-
entities based on their characteristics.
It is a top-down approach where higher level
entity s specialized into two or more lower level
entities.
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
Extended E-R Diagram >> Aggregation
22
Aggregation – an ER diagram is not capable of
representing relationship between an entity and
a relationship which may be required in some
scenarios. In those cases, a relationship with its
corresponding entities is aggregated into higher
level entity.
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Practice 1 (Banking Enterprise)
▸ The bank is organized into branches. Each branch is located in a particular city and is identified by a unique name. The
bank monitors the assets of each branch.
▸ Bank employees are identified by their employee-id values. The bank administration stores the name and telephone
number of each employee, the names of the employee’s dependents, and the employee-id number of the employee’s
manager. The bank also keeps track of the employee’s start date and, thus, length of employment.
▸ Bank customers are identified by their customer-id values. The bank stores each customer’s name, and the street and
city where the customer lives. Customers may have accounts and can take out loans. A customer may be associated
with a particular banker, who may act as a loan officer or personal banker for that customer.
▸ Accounts can be held by more than one customer, and a customer can have more than one account. Each account is
assigned a unique account number. The bank maintains a record of each account’s balance, and the most recent date
on which the account was accessed by each customer holding the account.
▸ A loan originates at a particular branch and can be held by one or more customers. A loan is identified by a unique loan
number. For each loan, the bank keeps track of the loan amount and the loan payments. Although a loan payment
number does not uniquely identify a particular payment among those for all the bank’s loans, a payment number does
identify a particular payment for a specific loan. The date and amount are recorded for each payment.
Construct an E-R Diagram for the bank enterprise.
23
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Practice 2 (Company Database)
▸ The company is organized into departments. Each department has a unique name, a unique number, and a particular
employee who manages the department. We keep track of the start date when that employee began managing the
department. A department may have several locations.
▸ A department controls a number of projects, each of which has a unique name, a unique number, and a single location.
▸ We store each employee’s name, social security number, address, salary, gender, and birth date. An employee is
assigned to one department but may work on several projects, which are not necessarily controlled by the same
department. We keep track of the number of hours per week that an employee works on each project. We also keep
track of the direct supervisor of each employee.
▸ We want to keep track of the dependents of each employee for insurance purposes. We keep each dependent’s first
name, gender, birth date, and relationship to the employee.
Draw the E-R Diagram.
24
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Practice 3 (Online Book Store Database)
▸ Every book has a title, isbn, year and price. The store also keeps the author and publisher for any book.
▸ For authors, the database keeps the name, address and the url of their homepage.
▸ For publishers, the database keeps the name, address, phone number and the url of their website.
▸ The store has several warehouses, each of which has a code, address and phone number. The warehouse stocks
several books. A book may be stocked at multiple warehouses. (In previous sentence, we are not referring to a
particular copy of the book. Consider for example “the complete book” for our course. This book may be stocked at
multiple warehouses.) The database records the number of copies of a book stocked at various warehouses.
▸ The bookstore keeps the name, address, email-id, and phone number of its customers.
▸ A customer owns several shopping basket. A shopping basket is identified by a basketID and contains several
books. Some shopping baskets may contain more than one copy of same book. The database records the number of
copies of each book in any shopping basket.
Design an ER diagram for such a bookstore.
25
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
E-R Diagram >> Practice 4 (Blog Management System)
26
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
Construct an ER diagram according to the details provided below:
▸ The blog management system maintains each blog writer’s unique email, name, encoded password, gender, date of
birth, join date, length of employment and address. The address field consists of three components: postal code, city
and street name. Every blog writer is hired by only one blog writer as his employer. The visitors may follow more than
one blog writer.
▸ Each of the blogs has blog id, details, date, time and category. One blog may fall under several categories. Here blog
id cannot uniquely identify a specific blog but blog id together with blog writer email can uniquely identify a specific
blog. A blog writer may publish several blogs.
▸ The visitors can see all the blogs published by writers. Each visitor can comment more than one time in each blog
and the system maintains the date, time, content of that blog comment. Visitors can also hit reactions (like/dislike) in
more than one blogs. The system maintains unique visitor email, visitor name and encrypted password for each
visitor.
E-R Diagram >> Practice 5 (League of Villains)
27
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
Consider the following Scenario:
The League of Villains is getting more and more prominent. To reduce the dominance of the villains,
hero society is thinking of positioning heroes in regions. However they first need to design a database
with the following conditions:
▸ Heroes have a unique name, a power, strength level and a rank. Villains also have properties similar to heroes. Also,
each villains may have a boss who is also a villain himself.
▸ A hero is responsible for a certain region. A region has latitude, longitude, and population. A region can be terrorized
by multiple villains. However, one villain does not terrorize more than a region.
▸ Heroes and villains often fight. Hero society needs to keep track of the dates and results of thesefights. A hero and a
villain may fight multiple times.
Design an ERD for the scenario.
E-R Diagram >> Practice 6 (Course Mgmt. System)
28
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
Consider the following scenario for Course Management System:
▸ The university stores all the student information that includes a unique student id, name, date of birth, address.
Address is stored in the following three sections: street name, postal code and city.
▸ Each course is identified by its unique course code, trimester, course name and course content. One course is
conducted by several faculties and a student can choose several courses in a single trimester.
▸ The university identifies each faculty through their unique employee id. Each faculty also has a particular room no,
name, contact no, email and join date. Each faculty is associated with anonymous reviews of students. Each review
consists of a review id, review details and datetime. The review id can’t identify a particular review among all the
reviews but the review id for a specific faculty can identify a particular review. Each student is also assigned to a
specific faculty for advising purpose.
Design an ER Diagram for the scenario that satisfies all the given requirements.
E-R Diagram >> Practice 7 (Job Portal System)
29
Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
Consider the following scenario for a Job portal:
▸ The job portal manages each user’s profile where each user is represented by his or her name, unique email, address,
date of birth, educational qualifications, job position and job experience. Both recruiters and job seekers are user and
one recruiter can recruit more than one job seeker.
▸ The recruiters can post job openings to the job portal. The job portal keeps track of each posts date, time, contents,
no of viewers. The system also keeps track of which job seeker is interested in which job posts.
▸ Each of the offices is maintained by their unique office id, name, address and contact no. Every user belongs to some
offices as a recruiter or, an employee or, a follower. Each person can provide his or her anonymous review of offices.
Each of the review contains review id, date, time, review details. The review id cannot uniquely identify a particular
review but a review id together with an office id can uniquely identify a particular review.
Design and ER Diagram for the scenario that satisfies all the given requirements.
30
THANKS!
Any questions?
Email : imam@cse.uiu.ac.bd
References:
▪ Database System Concepts by S. Sudarshan, Henry F. Korth, Abraham Silberschatz
▪ Database Systems The Complete Book by Ullman, Widom and Hector
▪ https://www.lucidchart.com/pages/er-diagrams
▪ https://www.vertabelo.com/blog/chen-erd-notation/

More Related Content

What's hot

Bsc cs ii-dbms- u-iii-data modeling using e.r. model (entity relationship model)
Bsc cs ii-dbms- u-iii-data modeling using e.r. model (entity relationship model)Bsc cs ii-dbms- u-iii-data modeling using e.r. model (entity relationship model)
Bsc cs ii-dbms- u-iii-data modeling using e.r. model (entity relationship model)
Rai University
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
Data structures chapter 1
Data structures chapter  1Data structures chapter  1
Data structures chapter 1
priyavanimurugarajan
 
Database keys
Database keysDatabase keys
Database keys
Rahul Mishra
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Vraj Patel
 
5. Group Functions
5. Group Functions5. Group Functions
5. Group Functions
Evelyn Oluchukwu
 
DBMS 7 | Relational Query Language
DBMS 7 | Relational Query LanguageDBMS 7 | Relational Query Language
DBMS 7 | Relational Query Language
Mohammad Imam Hossain
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
Shrija Madhu
 
Relational algebra
Relational algebraRelational algebra
Relational algebra
Dr. C.V. Suresh Babu
 
ER model to Relational model mapping
ER model to Relational model mappingER model to Relational model mapping
ER model to Relational model mappingShubham Saini
 
DBMS 9 | Extendible Hashing
DBMS 9 | Extendible HashingDBMS 9 | Extendible Hashing
DBMS 9 | Extendible Hashing
Mohammad Imam Hossain
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mappingsaurabhshertukde
 
Pseudo code of stack Queue and Array
Pseudo code of stack Queue and ArrayPseudo code of stack Queue and Array
Pseudo code of stack Queue and Array
rdp rehmatullah
 
TOC 5 | Regular Expressions
TOC 5 | Regular ExpressionsTOC 5 | Regular Expressions
TOC 5 | Regular Expressions
Mohammad Imam Hossain
 
DBMS Notes: DDL DML DCL
DBMS Notes: DDL DML DCLDBMS Notes: DDL DML DCL
DBMS Notes: DDL DML DCL
Sreedhar Chowdam
 
Cursors
CursorsCursors
SQL.ppt
SQL.pptSQL.ppt
SQL.ppt
Ranjit273515
 
Instruction codes and computer registers
Instruction codes and computer registersInstruction codes and computer registers
Instruction codes and computer registers
Sanjeev Patel
 
Computer Architecture – An Introduction
Computer Architecture – An IntroductionComputer Architecture – An Introduction
Computer Architecture – An Introduction
Dilum Bandara
 

What's hot (20)

Bsc cs ii-dbms- u-iii-data modeling using e.r. model (entity relationship model)
Bsc cs ii-dbms- u-iii-data modeling using e.r. model (entity relationship model)Bsc cs ii-dbms- u-iii-data modeling using e.r. model (entity relationship model)
Bsc cs ii-dbms- u-iii-data modeling using e.r. model (entity relationship model)
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
 
Data structures chapter 1
Data structures chapter  1Data structures chapter  1
Data structures chapter 1
 
Database keys
Database keysDatabase keys
Database keys
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
5. Group Functions
5. Group Functions5. Group Functions
5. Group Functions
 
DBMS 7 | Relational Query Language
DBMS 7 | Relational Query LanguageDBMS 7 | Relational Query Language
DBMS 7 | Relational Query Language
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 
Relational algebra
Relational algebraRelational algebra
Relational algebra
 
ER model to Relational model mapping
ER model to Relational model mappingER model to Relational model mapping
ER model to Relational model mapping
 
DBMS 9 | Extendible Hashing
DBMS 9 | Extendible HashingDBMS 9 | Extendible Hashing
DBMS 9 | Extendible Hashing
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mapping
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
Pseudo code of stack Queue and Array
Pseudo code of stack Queue and ArrayPseudo code of stack Queue and Array
Pseudo code of stack Queue and Array
 
TOC 5 | Regular Expressions
TOC 5 | Regular ExpressionsTOC 5 | Regular Expressions
TOC 5 | Regular Expressions
 
DBMS Notes: DDL DML DCL
DBMS Notes: DDL DML DCLDBMS Notes: DDL DML DCL
DBMS Notes: DDL DML DCL
 
Cursors
CursorsCursors
Cursors
 
SQL.ppt
SQL.pptSQL.ppt
SQL.ppt
 
Instruction codes and computer registers
Instruction codes and computer registersInstruction codes and computer registers
Instruction codes and computer registers
 
Computer Architecture – An Introduction
Computer Architecture – An IntroductionComputer Architecture – An Introduction
Computer Architecture – An Introduction
 

Similar to DBMS 2 | Entity Relationship Model

E - R Models.pptx SQL and plsql database
E - R Models.pptx SQL and plsql databaseE - R Models.pptx SQL and plsql database
E - R Models.pptx SQL and plsql database
ironman82715
 
ER MODEL
ER MODELER MODEL
ER MODEL
Rupali Rana
 
DBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptxDBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptx
parimala123
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
A. S. M. Shafi
 
database.pptx
database.pptxdatabase.pptx
database.pptx
lumaeducation
 
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
Mustafa Kamel Mohammadi
 
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxThe Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptx
MANASINANDKISHORDEOR
 
Entity Relationship Diagram – ER Diagram in DBMS.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptxEntity Relationship Diagram – ER Diagram in DBMS.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptx
sukrithlal008
 
Datamodels.pptx
Datamodels.pptxDatamodels.pptx
Datamodels.pptx
Ramya Nellutla
 
Er diagrams
Er diagramsEr diagrams
Er diagrams
VisnuDharsini
 
Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..
Nimrakhan89
 
ER model
ER modelER model
ER model
ShilpaDe
 
Desigining of Database - ER Model
Desigining of Database - ER ModelDesigining of Database - ER Model
Desigining of Database - ER Model
Ajay Chhimpa
 
ER Diagram_Kameshwari.docx
ER Diagram_Kameshwari.docxER Diagram_Kameshwari.docx
ER Diagram_Kameshwari.docx
KameshwariPurusothma
 
Entity_DBMS.pptx
Entity_DBMS.pptxEntity_DBMS.pptx
Entity_DBMS.pptx
vishnupriyapm4
 
Er model
Er modelEr model
Er model
Soumyajit Dutta
 
ERD with complete knowledge
ERD with complete knowledgeERD with complete knowledge
ERD with complete knowledge
Asma Rasool
 
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
gamuhuto
 

Similar to DBMS 2 | Entity Relationship Model (20)

E - R Models.pptx SQL and plsql database
E - R Models.pptx SQL and plsql databaseE - R Models.pptx SQL and plsql database
E - R Models.pptx SQL and plsql database
 
database
databasedatabase
database
 
ER MODEL
ER MODELER MODEL
ER MODEL
 
DBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptxDBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptx
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
 
database.pptx
database.pptxdatabase.pptx
database.pptx
 
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
 
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxThe Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptx
 
Entity Relationship Diagram – ER Diagram in DBMS.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptxEntity Relationship Diagram – ER Diagram in DBMS.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptx
 
Datamodels.pptx
Datamodels.pptxDatamodels.pptx
Datamodels.pptx
 
Er diagrams
Er diagramsEr diagrams
Er diagrams
 
Unit02 dbms
Unit02 dbmsUnit02 dbms
Unit02 dbms
 
Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..
 
ER model
ER modelER model
ER model
 
Desigining of Database - ER Model
Desigining of Database - ER ModelDesigining of Database - ER Model
Desigining of Database - ER Model
 
ER Diagram_Kameshwari.docx
ER Diagram_Kameshwari.docxER Diagram_Kameshwari.docx
ER Diagram_Kameshwari.docx
 
Entity_DBMS.pptx
Entity_DBMS.pptxEntity_DBMS.pptx
Entity_DBMS.pptx
 
Er model
Er modelEr model
Er model
 
ERD with complete knowledge
ERD with complete knowledgeERD with complete knowledge
ERD with complete knowledge
 
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
 

More from Mohammad Imam Hossain

DS & Algo 6 - Offline Assignment 6
DS & Algo 6 - Offline Assignment 6DS & Algo 6 - Offline Assignment 6
DS & Algo 6 - Offline Assignment 6
Mohammad Imam Hossain
 
DS & Algo 6 - Dynamic Programming
DS & Algo 6 - Dynamic ProgrammingDS & Algo 6 - Dynamic Programming
DS & Algo 6 - Dynamic Programming
Mohammad Imam Hossain
 
DS & Algo 5 - Disjoint Set and MST
DS & Algo 5 - Disjoint Set and MSTDS & Algo 5 - Disjoint Set and MST
DS & Algo 5 - Disjoint Set and MST
Mohammad Imam Hossain
 
DS & Algo 4 - Graph and Shortest Path Search
DS & Algo 4 - Graph and Shortest Path SearchDS & Algo 4 - Graph and Shortest Path Search
DS & Algo 4 - Graph and Shortest Path Search
Mohammad Imam Hossain
 
DS & Algo 3 - Offline Assignment 3
DS & Algo 3 - Offline Assignment 3DS & Algo 3 - Offline Assignment 3
DS & Algo 3 - Offline Assignment 3
Mohammad Imam Hossain
 
DS & Algo 3 - Divide and Conquer
DS & Algo 3 - Divide and ConquerDS & Algo 3 - Divide and Conquer
DS & Algo 3 - Divide and Conquer
Mohammad Imam Hossain
 
DS & Algo 2 - Offline Assignment 2
DS & Algo 2 - Offline Assignment 2DS & Algo 2 - Offline Assignment 2
DS & Algo 2 - Offline Assignment 2
Mohammad Imam Hossain
 
DS & Algo 2 - Recursion
DS & Algo 2 - RecursionDS & Algo 2 - Recursion
DS & Algo 2 - Recursion
Mohammad Imam Hossain
 
DS & Algo 1 - Offline Assignment 1
DS & Algo 1 - Offline Assignment 1DS & Algo 1 - Offline Assignment 1
DS & Algo 1 - Offline Assignment 1
Mohammad Imam Hossain
 
DS & Algo 1 - C++ and STL Introduction
DS & Algo 1 - C++ and STL IntroductionDS & Algo 1 - C++ and STL Introduction
DS & Algo 1 - C++ and STL Introduction
Mohammad Imam Hossain
 
TOC 10 | Turing Machine
TOC 10 | Turing MachineTOC 10 | Turing Machine
TOC 10 | Turing Machine
Mohammad Imam Hossain
 
TOC 9 | Pushdown Automata
TOC 9 | Pushdown AutomataTOC 9 | Pushdown Automata
TOC 9 | Pushdown Automata
Mohammad Imam Hossain
 
TOC 8 | Derivation, Parse Tree & Ambiguity Check
TOC 8 | Derivation, Parse Tree & Ambiguity CheckTOC 8 | Derivation, Parse Tree & Ambiguity Check
TOC 8 | Derivation, Parse Tree & Ambiguity Check
Mohammad Imam Hossain
 
TOC 7 | CFG in Chomsky Normal Form
TOC 7 | CFG in Chomsky Normal FormTOC 7 | CFG in Chomsky Normal Form
TOC 7 | CFG in Chomsky Normal Form
Mohammad Imam Hossain
 
TOC 6 | CFG Design
TOC 6 | CFG DesignTOC 6 | CFG Design
TOC 6 | CFG Design
Mohammad Imam Hossain
 
TOC 4 | Non-deterministic Finite Automata
TOC 4 | Non-deterministic Finite AutomataTOC 4 | Non-deterministic Finite Automata
TOC 4 | Non-deterministic Finite Automata
Mohammad Imam Hossain
 
TOC 3 | Different Operations on DFA
TOC 3 | Different Operations on DFATOC 3 | Different Operations on DFA
TOC 3 | Different Operations on DFA
Mohammad Imam Hossain
 
TOC 2 | Deterministic Finite Automata
TOC 2 | Deterministic Finite AutomataTOC 2 | Deterministic Finite Automata
TOC 2 | Deterministic Finite Automata
Mohammad Imam Hossain
 
TOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of ComputationTOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of Computation
Mohammad Imam Hossain
 
Web 6 | JavaScript DOM
Web 6 | JavaScript DOMWeb 6 | JavaScript DOM
Web 6 | JavaScript DOM
Mohammad Imam Hossain
 

More from Mohammad Imam Hossain (20)

DS & Algo 6 - Offline Assignment 6
DS & Algo 6 - Offline Assignment 6DS & Algo 6 - Offline Assignment 6
DS & Algo 6 - Offline Assignment 6
 
DS & Algo 6 - Dynamic Programming
DS & Algo 6 - Dynamic ProgrammingDS & Algo 6 - Dynamic Programming
DS & Algo 6 - Dynamic Programming
 
DS & Algo 5 - Disjoint Set and MST
DS & Algo 5 - Disjoint Set and MSTDS & Algo 5 - Disjoint Set and MST
DS & Algo 5 - Disjoint Set and MST
 
DS & Algo 4 - Graph and Shortest Path Search
DS & Algo 4 - Graph and Shortest Path SearchDS & Algo 4 - Graph and Shortest Path Search
DS & Algo 4 - Graph and Shortest Path Search
 
DS & Algo 3 - Offline Assignment 3
DS & Algo 3 - Offline Assignment 3DS & Algo 3 - Offline Assignment 3
DS & Algo 3 - Offline Assignment 3
 
DS & Algo 3 - Divide and Conquer
DS & Algo 3 - Divide and ConquerDS & Algo 3 - Divide and Conquer
DS & Algo 3 - Divide and Conquer
 
DS & Algo 2 - Offline Assignment 2
DS & Algo 2 - Offline Assignment 2DS & Algo 2 - Offline Assignment 2
DS & Algo 2 - Offline Assignment 2
 
DS & Algo 2 - Recursion
DS & Algo 2 - RecursionDS & Algo 2 - Recursion
DS & Algo 2 - Recursion
 
DS & Algo 1 - Offline Assignment 1
DS & Algo 1 - Offline Assignment 1DS & Algo 1 - Offline Assignment 1
DS & Algo 1 - Offline Assignment 1
 
DS & Algo 1 - C++ and STL Introduction
DS & Algo 1 - C++ and STL IntroductionDS & Algo 1 - C++ and STL Introduction
DS & Algo 1 - C++ and STL Introduction
 
TOC 10 | Turing Machine
TOC 10 | Turing MachineTOC 10 | Turing Machine
TOC 10 | Turing Machine
 
TOC 9 | Pushdown Automata
TOC 9 | Pushdown AutomataTOC 9 | Pushdown Automata
TOC 9 | Pushdown Automata
 
TOC 8 | Derivation, Parse Tree & Ambiguity Check
TOC 8 | Derivation, Parse Tree & Ambiguity CheckTOC 8 | Derivation, Parse Tree & Ambiguity Check
TOC 8 | Derivation, Parse Tree & Ambiguity Check
 
TOC 7 | CFG in Chomsky Normal Form
TOC 7 | CFG in Chomsky Normal FormTOC 7 | CFG in Chomsky Normal Form
TOC 7 | CFG in Chomsky Normal Form
 
TOC 6 | CFG Design
TOC 6 | CFG DesignTOC 6 | CFG Design
TOC 6 | CFG Design
 
TOC 4 | Non-deterministic Finite Automata
TOC 4 | Non-deterministic Finite AutomataTOC 4 | Non-deterministic Finite Automata
TOC 4 | Non-deterministic Finite Automata
 
TOC 3 | Different Operations on DFA
TOC 3 | Different Operations on DFATOC 3 | Different Operations on DFA
TOC 3 | Different Operations on DFA
 
TOC 2 | Deterministic Finite Automata
TOC 2 | Deterministic Finite AutomataTOC 2 | Deterministic Finite Automata
TOC 2 | Deterministic Finite Automata
 
TOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of ComputationTOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of Computation
 
Web 6 | JavaScript DOM
Web 6 | JavaScript DOMWeb 6 | JavaScript DOM
Web 6 | JavaScript DOM
 

Recently uploaded

Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 

Recently uploaded (20)

Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 

DBMS 2 | Entity Relationship Model

  • 1. Database Management System E-R Data Model Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 2. Design Phases 2 Physical-design Phase [Relational Database] Logical-design Phase [Relational Schema] Conceptual-design Phase [ER Diagram] User Requirements Specification Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 3. Conceptual Design >> E-R Data Model ▸ Entity-relationship(E-R) data model is used to represent the conceptual design. It maps the meanings and interactions of real-world enterprises onto a conceptual schema. ▸ The E-R data model perceives the real world as consisting of basic objects, called entities, and relationships among these objects. ▸ The E-R model has an associated diagrammatic representation, the E-R diagram. E-R diagram can express the overall logical structure of a database graphically. ▸ Three principal concepts: ▪ Entity sets ▪ Attributes ▪ Relationship sets ▸ We will consider Chen Model Notations for our E-R Diagram. 3 Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 4. E-R Diagram >> Components ▸ Entity: It is a real-world object about which we collect data. In other words, it is a definable thing that can have data stored about it. ▸ Entity Set: An entity set is a set of entities of the same type that share the same properties or attributes. ▸ Attributes: Attributes are descriptive properties of the entities in the entity set. Each entity has its own value for each attribute. ▸ Relationship: It is an association among several entities. ▸ Relationship Set: It is a set of relationships of the same type. 4 Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 5. E-R Diagram >> Components 5 Entity Entity Set Attribute Relationship Relationship Set Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 6. E-R Diagram >> Attributes 6 Simple – Attribute value is atomic and can’t be divided into subparts. Composite – Attributes that can be divided into subparts i.e. other attributes. Derived – Attributes that can be calculated from other related attributes. Multivalued – Attributes having more than one values (a set of values) for a specific entity. SimpleAttr address street zipCode city age ContactNo Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 7. E-R Diagram >> Relationship Attributes 7 Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU One-to-Many Relationship Set Many-to-Many Relationship Set
  • 8. E-R Diagram >> Relationship Attributes 8 Descriptive Attribute – Properties/characteristics of a relationship. This type of attributes can’t be associated with any entity sets that the relationship set links. Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 9. Superkey – A set of one or more attributes that, taken collectively, allow us to identify uniquely an entity in the entity set. Candidate key – A minimal (irreducible) superkey such that no proper subset of its attributes is also a superkey. Primary key – The candidate key chosen to be used for identifying entities and accessing records. Key attribute – An attribute that is part of a (primary) key. Partial key/Discriminator – an attribute that when combined with the key attribute of the owner entity, provides identification for the weak entity. E-R Diagram >> Keys 9 KeyAttribute PartialKeyAttr Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 10. Composite key – A key that is composed of more than one attribute. Foreign key – An attribute or combination of attributes in one table whose values must either match the primary key in another table or be null. Foreign keys are used to ensure referential integrity, the condition in which every foreign key entry must either be null or a valid value in the primary key of the related table. Relational Database Keys 10 Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 11. E-R Diagram >> Entity Sets 11 Strong Entity Set – has enough attributes to uniquely identify each entity. Weak Entity Set – It is one whose existence is dependent on another (identifying) entity set. The primary key attributes of the identifying entity set, along with the discriminator (partial key) attributes of its own are used to uniquely identify each weak entity. customer id name street city Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 12. E-R Diagram >> Entity Sets 12 Associative Entity Set – This type of entity set is used in a many-to-many relationship. When you need a relationship to be involved in a relationship then the former relationship is converted to an associative entity. course student enroll ment course student enroll ment teacher teach Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 13. E-R Diagram >> Example 13 Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 14. E-R Diagram >> Relationship Sets 14 Non-Identifying Relationship Set – A relationship where child entity is existence-independent of parent entity, and primary key of child doesn’t contain primary key component of parent entity. In terms of relationship strength, it is also known as weak relationship. Identifying Relationship Set – A relationship where child entity is existence-dependent on parent (identifying) entity, and primary key of child entity contains primary key component of parent entity. The identifying relationship set should not have any descriptive attributes, since any such attributes can instead be associated with the weak entity set. In terms of relationship strength, it is also known as strong relationship. RelSet Identifying RelSet Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 15. E-R Diagram >> Relationship Sets 15 Recursive Relationship Set – The same entity set participates more than once in the relationship. ▪ The function that an entity plays in a relationship is called that entity’s role. ▪ Since entity sets participating in a relationship set are generally distinct, roles are implicit and are not usually specified. ▪ However, they are useful when the meaning of a relationship needs clarification. Parallel Relationship Set – more than one relationships between the same entity sets. Students Courses Take TA Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 16. E-R Diagram >> Mapping Cardinalities 16 One-to-one(1:1) – An entity in A is associated with at most one entity in B, and an entity in B is associated with at most one entity in A. Mapping cardinalities, or Cardinality ratios, express the number of entities to which another entity can be associated via a relationship set. department chairperson chair- dept Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 17. E-R Diagram >> Mapping Cardinalities 17 One-to-many (1:N) – An entity in A is associated with any number of entities in B. An entity in B, however, can be associated with at most one entity in A. class faculty faculty -class Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 18. E-R Diagram >> Mapping Cardinalities 18 Many-to-many (M:N) – An entity in A is associated with any number of entities in B, and an entity in B is associated with any number of entities in A. class student enroll Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 19. E-R Diagram >> Participation Constraints 19 Total participation – Every member of the entity set must participate in the relationship Partial participation – Not all entities in the set are involved in the relationship. In the previous example not every professor guides student. student professor guides Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 20. Extended E-R Diagram >> Generalization 20 Generalization – It is the process of extracting common properties from a set of entities and create a generalized entity from it. It is a bottom-up approach in which tow or more entities can be generalized to a higher level entity if they have some attributes in common. Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 21. Extended E-R Diagram >> Specialization 21 Specialization – an entity is divided into sub- entities based on their characteristics. It is a top-down approach where higher level entity s specialized into two or more lower level entities. Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 22. Extended E-R Diagram >> Aggregation 22 Aggregation – an ER diagram is not capable of representing relationship between an entity and a relationship which may be required in some scenarios. In those cases, a relationship with its corresponding entities is aggregated into higher level entity. Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 23. E-R Diagram >> Practice 1 (Banking Enterprise) ▸ The bank is organized into branches. Each branch is located in a particular city and is identified by a unique name. The bank monitors the assets of each branch. ▸ Bank employees are identified by their employee-id values. The bank administration stores the name and telephone number of each employee, the names of the employee’s dependents, and the employee-id number of the employee’s manager. The bank also keeps track of the employee’s start date and, thus, length of employment. ▸ Bank customers are identified by their customer-id values. The bank stores each customer’s name, and the street and city where the customer lives. Customers may have accounts and can take out loans. A customer may be associated with a particular banker, who may act as a loan officer or personal banker for that customer. ▸ Accounts can be held by more than one customer, and a customer can have more than one account. Each account is assigned a unique account number. The bank maintains a record of each account’s balance, and the most recent date on which the account was accessed by each customer holding the account. ▸ A loan originates at a particular branch and can be held by one or more customers. A loan is identified by a unique loan number. For each loan, the bank keeps track of the loan amount and the loan payments. Although a loan payment number does not uniquely identify a particular payment among those for all the bank’s loans, a payment number does identify a particular payment for a specific loan. The date and amount are recorded for each payment. Construct an E-R Diagram for the bank enterprise. 23 Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 24. E-R Diagram >> Practice 2 (Company Database) ▸ The company is organized into departments. Each department has a unique name, a unique number, and a particular employee who manages the department. We keep track of the start date when that employee began managing the department. A department may have several locations. ▸ A department controls a number of projects, each of which has a unique name, a unique number, and a single location. ▸ We store each employee’s name, social security number, address, salary, gender, and birth date. An employee is assigned to one department but may work on several projects, which are not necessarily controlled by the same department. We keep track of the number of hours per week that an employee works on each project. We also keep track of the direct supervisor of each employee. ▸ We want to keep track of the dependents of each employee for insurance purposes. We keep each dependent’s first name, gender, birth date, and relationship to the employee. Draw the E-R Diagram. 24 Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 25. E-R Diagram >> Practice 3 (Online Book Store Database) ▸ Every book has a title, isbn, year and price. The store also keeps the author and publisher for any book. ▸ For authors, the database keeps the name, address and the url of their homepage. ▸ For publishers, the database keeps the name, address, phone number and the url of their website. ▸ The store has several warehouses, each of which has a code, address and phone number. The warehouse stocks several books. A book may be stocked at multiple warehouses. (In previous sentence, we are not referring to a particular copy of the book. Consider for example “the complete book” for our course. This book may be stocked at multiple warehouses.) The database records the number of copies of a book stocked at various warehouses. ▸ The bookstore keeps the name, address, email-id, and phone number of its customers. ▸ A customer owns several shopping basket. A shopping basket is identified by a basketID and contains several books. Some shopping baskets may contain more than one copy of same book. The database records the number of copies of each book in any shopping basket. Design an ER diagram for such a bookstore. 25 Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU
  • 26. E-R Diagram >> Practice 4 (Blog Management System) 26 Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU Construct an ER diagram according to the details provided below: ▸ The blog management system maintains each blog writer’s unique email, name, encoded password, gender, date of birth, join date, length of employment and address. The address field consists of three components: postal code, city and street name. Every blog writer is hired by only one blog writer as his employer. The visitors may follow more than one blog writer. ▸ Each of the blogs has blog id, details, date, time and category. One blog may fall under several categories. Here blog id cannot uniquely identify a specific blog but blog id together with blog writer email can uniquely identify a specific blog. A blog writer may publish several blogs. ▸ The visitors can see all the blogs published by writers. Each visitor can comment more than one time in each blog and the system maintains the date, time, content of that blog comment. Visitors can also hit reactions (like/dislike) in more than one blogs. The system maintains unique visitor email, visitor name and encrypted password for each visitor.
  • 27. E-R Diagram >> Practice 5 (League of Villains) 27 Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU Consider the following Scenario: The League of Villains is getting more and more prominent. To reduce the dominance of the villains, hero society is thinking of positioning heroes in regions. However they first need to design a database with the following conditions: ▸ Heroes have a unique name, a power, strength level and a rank. Villains also have properties similar to heroes. Also, each villains may have a boss who is also a villain himself. ▸ A hero is responsible for a certain region. A region has latitude, longitude, and population. A region can be terrorized by multiple villains. However, one villain does not terrorize more than a region. ▸ Heroes and villains often fight. Hero society needs to keep track of the dates and results of thesefights. A hero and a villain may fight multiple times. Design an ERD for the scenario.
  • 28. E-R Diagram >> Practice 6 (Course Mgmt. System) 28 Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU Consider the following scenario for Course Management System: ▸ The university stores all the student information that includes a unique student id, name, date of birth, address. Address is stored in the following three sections: street name, postal code and city. ▸ Each course is identified by its unique course code, trimester, course name and course content. One course is conducted by several faculties and a student can choose several courses in a single trimester. ▸ The university identifies each faculty through their unique employee id. Each faculty also has a particular room no, name, contact no, email and join date. Each faculty is associated with anonymous reviews of students. Each review consists of a review id, review details and datetime. The review id can’t identify a particular review among all the reviews but the review id for a specific faculty can identify a particular review. Each student is also assigned to a specific faculty for advising purpose. Design an ER Diagram for the scenario that satisfies all the given requirements.
  • 29. E-R Diagram >> Practice 7 (Job Portal System) 29 Mohammad Imam Hossain, Lecturer, Dept. of CSE, UIU Consider the following scenario for a Job portal: ▸ The job portal manages each user’s profile where each user is represented by his or her name, unique email, address, date of birth, educational qualifications, job position and job experience. Both recruiters and job seekers are user and one recruiter can recruit more than one job seeker. ▸ The recruiters can post job openings to the job portal. The job portal keeps track of each posts date, time, contents, no of viewers. The system also keeps track of which job seeker is interested in which job posts. ▸ Each of the offices is maintained by their unique office id, name, address and contact no. Every user belongs to some offices as a recruiter or, an employee or, a follower. Each person can provide his or her anonymous review of offices. Each of the review contains review id, date, time, review details. The review id cannot uniquely identify a particular review but a review id together with an office id can uniquely identify a particular review. Design and ER Diagram for the scenario that satisfies all the given requirements.
  • 30. 30 THANKS! Any questions? Email : imam@cse.uiu.ac.bd References: ▪ Database System Concepts by S. Sudarshan, Henry F. Korth, Abraham Silberschatz ▪ Database Systems The Complete Book by Ullman, Widom and Hector ▪ https://www.lucidchart.com/pages/er-diagrams ▪ https://www.vertabelo.com/blog/chen-erd-notation/