SlideShare a Scribd company logo
1 of 44
4/6/2022 1
Yan Huang - ER
Chapter 6: ER – Entity
Relationship Diagram
 Major components of ER diagram
 Practices
4/6/2022 2
Yan Huang - ER
ER
 1976 proposed by Peter Chen
 ER diagram is widely used in database design
 Represent conceptual level of a database system
 Describe things and their relationships in high level
4/6/2022 3
Yan Huang - ER
Basic Concepts
 Entity set – an abstraction of similar things, e.g.
cars, students
 An entity set contains many entities
 Attributes: common properties of the entities in
a entity sets
 Relationship – specify the relations among
entities from two or more entity sets
4/6/2022 4
Yan Huang - ER
An Example
4/6/2022 5
Yan Huang - ER
Relationship
 A relationship may be thought as a set as well
 For binary relationship, it enumerates the pairs of
entities that relate to each other
 For example, entity set M = {Mike, Jack, Tom} entity
set F = {Mary, Kate}. The relationship set married
between M and F may be {<Mike,Mary>,<Tom,
Kate>}
4/6/2022 6
Yan Huang - ER
Relationship
 A relationship set is a mathematical relation among n
 2 entities, each taken from entity sets
{(e1, e2, … en) | e1  E1, e2  E2, …, en 
En}
where (e1, e2, …, en) is a relationship
 Example:
(Hayes, A-102)  depositor
4/6/2022 7
Yan Huang - ER
Relationship Example
4/6/2022 8
Yan Huang - ER
Attribute of A Relationship Set
4/6/2022 9
Yan Huang - ER
Relationship
 The degree of a relationship = the number of
entity sets that participate in the relationship
 Mostly binary relationships
 Sometimes more
 Mapping cardinality of a relationship
 1 –1
 1 – many
 many – 1
 Many-many
4/6/2022 10
Yan Huang - ER
One-One and One-Many
4/6/2022 11
Yan Huang - ER
Many-one and many-many
4/6/2022 12
Yan Huang - ER
1- many
4/6/2022 13
Yan Huang - ER
Many - 1
4/6/2022 14
Yan Huang - ER
Many - many
4/6/2022 15
Yan Huang -CSCE4350 - ER
Alternative Cardinality
Specification
4/6/2022 16
Yan Huang - ER
Note on Mapping Cardinality
 Both many and 1 include 0
 Meaning some entity may not participate in the
relationship
4/6/2022 17
Yan Huang - ER
Total Participation
•When we require all entities to participate in the relationship
(total participation), we use double lines to specify
Every loan has to have at
least one customer
4/6/2022 18
Yan Huang - ER
Self Relationship
 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
4/6/2022 19
Yan Huang - ER
More examples on self-
relationship
 People to people
 Parent – children
 Manager – employee
 Husband – wife
 Word to word
 Root – synonym
4/6/2022 20
Yan Huang 350 - ER
Attributes
 Both entity sets and relationships can have
attributes
 Attributes may be
 Composite
 Multi-valued (double ellipse)
 Derive (dashed ellipse)
4/6/2022 21
Yan Huang - ER
Another Example
4/6/2022 22
Yan Huang - ER
Keys
 A super key of an entity set is a set of one or
more attributes whose values uniquely
determine each entity.
 A candidate key of an entity set is a minimal
super key
 Although several candidate keys may exist, one
of the candidate keys is selected to be the
primary key.
4/6/2022 23
Yan Huang - ER
Key Examples
 Suggest super keys for the following entity?
 What are the candidate keys?
 Primary key?
author
name
birthday
death
description
4/6/2022 24
Yan Huang - - ER
Ternary Relationship
4/6/2022 25
Yan Huang - ER
Can We Decompose a Ternary
Relationship?
 Some relationships that appear to be non-binary
may be better represented using binary
relationships
 E.g. A ternary relationship parents, relating a child to
his/her father and mother, is best replaced by two
binary relationships, father and mother
 Using two binary relationships allows partial information (e.g.
only mother being know)
 But there are some relationships that are naturally
non-binary
 E.g. works-on, why?
4/6/2022 26
Yan Huang - ER
Converting Ternary to binary
 In general, any non-binary relationship can be represented using
binary relationships by creating an artificial entity set.
 Replace R between entity sets A, B and C by an entity set E, and three
relationship sets:
1. RA, relating E and A 2.RB, relating E and B
3. RC, relating E and C
 Create a special identifying attribute for E
 Add any attributes of R to E
 For each relationship (ai , bi , ci) in R, create
1. a new entity ei in the entity set E 2. add (ei , ai ) to RA
3. add (ei , bi ) to RB 4. add (ei , ci ) to RC
4/6/2022 27
Yan Huang - ER
Converting Ternary to binary
4/6/2022 28
Yan Huang - ER
Design an ER Diagram
 Design a database for an on-line reservation
system for microscopes in material science lab
 There are two types of users: microscope
administrators and microscope end users
 Each microscope is located in a specific lab
 Each request is assigned to an administrator
who can authorize or deny the request
 Using of some microscope requires the presence
of an administrator
 Time is divided into 1 hour slots. Each
reservation can only take one or more time slots
4/6/2022 29
Yan Huang - ER
Weak Entity Set
 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
 Example:
 section1, section2, … become unique only if you put
them into a context, e.g. csce4350
4/6/2022 30
Yan Huang - ER
Weak Entity Set Notations
Double rectangles for weak entity set
Double diamond for weak entity relationship
Dashed underscore for discriminator
4/6/2022 31
Yan Huang - ER
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
4/6/2022 32
Yan Huang - ER
4/6/2022 33
Yan Huang - ER
Specification
 Disjoint
 Completeness constraint (use double lines)
 total : an entity must belong to one of the lower-
level entity sets
 partial: an entity need not belong to one of the
lower-level entity sets
4/6/2022 34
Yan Huang - ER
Design Considerations
 Use of entity sets vs. attributes
 Whether we want to keep additional information
 Use of entity sets vs. relationship sets
 Actions among entities are usually represented by
relationships
 Binary versus n-ary relationship sets
 N-nary relationships are usually more natural for
actions among entity sets
 Weak entity set vs. strong entity set
 Generalization
4/6/2022 35
Yan Huang - ER
Notations
4/6/2022 36
Yan Huang - ER
Notations
4/6/2022 37
Yan Huang - ER
ER Practice Again
 Design an ER diagram for an online music store.
The database will contain at least the following
concepts: songs, artists, bands, albums, and
genres.
 State your design assumptions you make to
support design decisions. Be sure your
assumptions are reasonable.
4/6/2022 38
Yan Huang CE4350 - ER
Best Practice Guide for ER Design
 Use of entity sets vs. attributes
 Use of entity sets vs. relationship sets
 Binary versus n-ary relationship sets
 Weak entity set vs. strong entity set
 Choose the natural one
 Generalization
 If specialized entities need to keep additional
information and participate in additional relationships
4/6/2022 39
Yan Huang - ER
ER for Banking Enterprise
 Description handhout
4/6/2022 40
Yan Huang - ER
Read ER Diagrams
 Following are some ER diagrams grabbed from
the web
 Read to understand/criticize
4/6/2022 41
Yan Huang - ER
?
?
?
?
?
?
?
?
?
4/6/2022 42
Yan Huang -CSCE4350 - ER
? ? ?
?
?
4/6/2022 43
Yan Huang -CSCE4350 - ER
?
4/6/2022 44
Yan Huang -CSCE4350 - ER

More Related Content

What's hot

Database Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity TypesDatabase Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity Types
aakanksha s
 
Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2
eidah20
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
koolkampus
 

What's hot (19)

DBMS UNIT1
DBMS UNIT1DBMS UNIT1
DBMS UNIT1
 
Er model
Er modelEr model
Er model
 
PHP mysql Er diagram
PHP mysql  Er diagramPHP mysql  Er diagram
PHP mysql Er diagram
 
Entity relationship diagram
Entity relationship diagramEntity relationship diagram
Entity relationship diagram
 
Er model
Er modelEr model
Er model
 
Er model ppt
Er model pptEr model ppt
Er model ppt
 
Database Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity TypesDatabase Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity Types
 
Design issues with constraints of E-R model
Design issues with constraints of E-R modelDesign issues with constraints of E-R model
Design issues with constraints of E-R 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)
Bsc cs ii-dbms- u-iii-data modeling using e.r. model (entity relationship model)
 
Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
 
E r diagram
E r diagramE r diagram
E r diagram
 
ER Model ppt
ER Model pptER Model ppt
ER Model ppt
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
ER Diagram
ER DiagramER Diagram
ER Diagram
 
Schema relationship to E-R diagram
Schema relationship to E-R diagramSchema relationship to E-R diagram
Schema relationship to E-R diagram
 
E r model
E r modelE r model
E r model
 
Entity relationship model
Entity relationship modelEntity relationship model
Entity relationship model
 
ER MODEL
ER MODELER MODEL
ER MODEL
 

Similar to 1 er

Database Systems Design, Implementation, and Manageme.docx
Database Systems Design, Implementation, and Manageme.docxDatabase Systems Design, Implementation, and Manageme.docx
Database Systems Design, Implementation, and Manageme.docx
theodorelove43763
 
Er Model Nandha&Mani
Er Model Nandha&ManiEr Model Nandha&Mani
Er Model Nandha&Mani
guest1e0229a
 

Similar to 1 er (20)

Er
ErEr
Er
 
Er1
Er1Er1
Er1
 
UNIT II DBMS.pptx
UNIT II DBMS.pptxUNIT II DBMS.pptx
UNIT II DBMS.pptx
 
database
databasedatabase
database
 
database.pptx
database.pptxdatabase.pptx
database.pptx
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
 
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...
 
L7 er2
L7 er2L7 er2
L7 er2
 
Er diagrams
Er diagramsEr diagrams
Er diagrams
 
Dbms 7: ER Diagram Design Issue
Dbms 7: ER Diagram Design IssueDbms 7: ER Diagram Design Issue
Dbms 7: ER Diagram Design Issue
 
Database Systems Design, Implementation, and Manageme.docx
Database Systems Design, Implementation, and Manageme.docxDatabase Systems Design, Implementation, and Manageme.docx
Database Systems Design, Implementation, and Manageme.docx
 
Chap05 c
Chap05 cChap05 c
Chap05 c
 
Entity Relation Diagram
Entity Relation DiagramEntity Relation Diagram
Entity Relation Diagram
 
Introduction to database-ER Model
Introduction to database-ER ModelIntroduction to database-ER Model
Introduction to database-ER Model
 
Datamodelling
DatamodellingDatamodelling
Datamodelling
 
ER diagram - Krishna Geetha.ppt
ER diagram - Krishna Geetha.pptER diagram - Krishna Geetha.ppt
ER diagram - Krishna Geetha.ppt
 
Unit02 dbms
Unit02 dbmsUnit02 dbms
Unit02 dbms
 
Er Model Nandha&Mani
Er Model Nandha&ManiEr Model Nandha&Mani
Er Model Nandha&Mani
 
dbms er model
dbms er modeldbms er model
dbms er model
 
U2_ER_upto_map_relations.pdf
U2_ER_upto_map_relations.pdfU2_ER_upto_map_relations.pdf
U2_ER_upto_map_relations.pdf
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 

1 er

  • 1. 4/6/2022 1 Yan Huang - ER Chapter 6: ER – Entity Relationship Diagram  Major components of ER diagram  Practices
  • 2. 4/6/2022 2 Yan Huang - ER ER  1976 proposed by Peter Chen  ER diagram is widely used in database design  Represent conceptual level of a database system  Describe things and their relationships in high level
  • 3. 4/6/2022 3 Yan Huang - ER Basic Concepts  Entity set – an abstraction of similar things, e.g. cars, students  An entity set contains many entities  Attributes: common properties of the entities in a entity sets  Relationship – specify the relations among entities from two or more entity sets
  • 4. 4/6/2022 4 Yan Huang - ER An Example
  • 5. 4/6/2022 5 Yan Huang - ER Relationship  A relationship may be thought as a set as well  For binary relationship, it enumerates the pairs of entities that relate to each other  For example, entity set M = {Mike, Jack, Tom} entity set F = {Mary, Kate}. The relationship set married between M and F may be {<Mike,Mary>,<Tom, Kate>}
  • 6. 4/6/2022 6 Yan Huang - ER Relationship  A relationship set is a mathematical relation among n  2 entities, each taken from entity sets {(e1, e2, … en) | e1  E1, e2  E2, …, en  En} where (e1, e2, …, en) is a relationship  Example: (Hayes, A-102)  depositor
  • 7. 4/6/2022 7 Yan Huang - ER Relationship Example
  • 8. 4/6/2022 8 Yan Huang - ER Attribute of A Relationship Set
  • 9. 4/6/2022 9 Yan Huang - ER Relationship  The degree of a relationship = the number of entity sets that participate in the relationship  Mostly binary relationships  Sometimes more  Mapping cardinality of a relationship  1 –1  1 – many  many – 1  Many-many
  • 10. 4/6/2022 10 Yan Huang - ER One-One and One-Many
  • 11. 4/6/2022 11 Yan Huang - ER Many-one and many-many
  • 12. 4/6/2022 12 Yan Huang - ER 1- many
  • 13. 4/6/2022 13 Yan Huang - ER Many - 1
  • 14. 4/6/2022 14 Yan Huang - ER Many - many
  • 15. 4/6/2022 15 Yan Huang -CSCE4350 - ER Alternative Cardinality Specification
  • 16. 4/6/2022 16 Yan Huang - ER Note on Mapping Cardinality  Both many and 1 include 0  Meaning some entity may not participate in the relationship
  • 17. 4/6/2022 17 Yan Huang - ER Total Participation •When we require all entities to participate in the relationship (total participation), we use double lines to specify Every loan has to have at least one customer
  • 18. 4/6/2022 18 Yan Huang - ER Self Relationship  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
  • 19. 4/6/2022 19 Yan Huang - ER More examples on self- relationship  People to people  Parent – children  Manager – employee  Husband – wife  Word to word  Root – synonym
  • 20. 4/6/2022 20 Yan Huang 350 - ER Attributes  Both entity sets and relationships can have attributes  Attributes may be  Composite  Multi-valued (double ellipse)  Derive (dashed ellipse)
  • 21. 4/6/2022 21 Yan Huang - ER Another Example
  • 22. 4/6/2022 22 Yan Huang - ER Keys  A super key of an entity set is a set of one or more attributes whose values uniquely determine each entity.  A candidate key of an entity set is a minimal super key  Although several candidate keys may exist, one of the candidate keys is selected to be the primary key.
  • 23. 4/6/2022 23 Yan Huang - ER Key Examples  Suggest super keys for the following entity?  What are the candidate keys?  Primary key? author name birthday death description
  • 24. 4/6/2022 24 Yan Huang - - ER Ternary Relationship
  • 25. 4/6/2022 25 Yan Huang - ER Can We Decompose a Ternary Relationship?  Some relationships that appear to be non-binary may be better represented using binary relationships  E.g. A ternary relationship parents, relating a child to his/her father and mother, is best replaced by two binary relationships, father and mother  Using two binary relationships allows partial information (e.g. only mother being know)  But there are some relationships that are naturally non-binary  E.g. works-on, why?
  • 26. 4/6/2022 26 Yan Huang - ER Converting Ternary to binary  In general, any non-binary relationship can be represented using binary relationships by creating an artificial entity set.  Replace R between entity sets A, B and C by an entity set E, and three relationship sets: 1. RA, relating E and A 2.RB, relating E and B 3. RC, relating E and C  Create a special identifying attribute for E  Add any attributes of R to E  For each relationship (ai , bi , ci) in R, create 1. a new entity ei in the entity set E 2. add (ei , ai ) to RA 3. add (ei , bi ) to RB 4. add (ei , ci ) to RC
  • 27. 4/6/2022 27 Yan Huang - ER Converting Ternary to binary
  • 28. 4/6/2022 28 Yan Huang - ER Design an ER Diagram  Design a database for an on-line reservation system for microscopes in material science lab  There are two types of users: microscope administrators and microscope end users  Each microscope is located in a specific lab  Each request is assigned to an administrator who can authorize or deny the request  Using of some microscope requires the presence of an administrator  Time is divided into 1 hour slots. Each reservation can only take one or more time slots
  • 29. 4/6/2022 29 Yan Huang - ER Weak Entity Set  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  Example:  section1, section2, … become unique only if you put them into a context, e.g. csce4350
  • 30. 4/6/2022 30 Yan Huang - ER Weak Entity Set Notations Double rectangles for weak entity set Double diamond for weak entity relationship Dashed underscore for discriminator
  • 31. 4/6/2022 31 Yan Huang - ER 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
  • 33. 4/6/2022 33 Yan Huang - ER Specification  Disjoint  Completeness constraint (use double lines)  total : an entity must belong to one of the lower- level entity sets  partial: an entity need not belong to one of the lower-level entity sets
  • 34. 4/6/2022 34 Yan Huang - ER Design Considerations  Use of entity sets vs. attributes  Whether we want to keep additional information  Use of entity sets vs. relationship sets  Actions among entities are usually represented by relationships  Binary versus n-ary relationship sets  N-nary relationships are usually more natural for actions among entity sets  Weak entity set vs. strong entity set  Generalization
  • 35. 4/6/2022 35 Yan Huang - ER Notations
  • 36. 4/6/2022 36 Yan Huang - ER Notations
  • 37. 4/6/2022 37 Yan Huang - ER ER Practice Again  Design an ER diagram for an online music store. The database will contain at least the following concepts: songs, artists, bands, albums, and genres.  State your design assumptions you make to support design decisions. Be sure your assumptions are reasonable.
  • 38. 4/6/2022 38 Yan Huang CE4350 - ER Best Practice Guide for ER Design  Use of entity sets vs. attributes  Use of entity sets vs. relationship sets  Binary versus n-ary relationship sets  Weak entity set vs. strong entity set  Choose the natural one  Generalization  If specialized entities need to keep additional information and participate in additional relationships
  • 39. 4/6/2022 39 Yan Huang - ER ER for Banking Enterprise  Description handhout
  • 40. 4/6/2022 40 Yan Huang - ER Read ER Diagrams  Following are some ER diagrams grabbed from the web  Read to understand/criticize
  • 41. 4/6/2022 41 Yan Huang - ER ? ? ? ? ? ? ? ? ?
  • 42. 4/6/2022 42 Yan Huang -CSCE4350 - ER ? ? ? ? ?
  • 43. 4/6/2022 43 Yan Huang -CSCE4350 - ER ?
  • 44. 4/6/2022 44 Yan Huang -CSCE4350 - ER