SlideShare a Scribd company logo
1
Entity Relationship Diagram
ER
2
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
Basic Concepts
3
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
An Example
4
Relationship
5
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>}
Relationship
6
 AA relationshiprelationship setset is a mathematical relation amongis a mathematical relation among nn
≥≥ 2 entities, each taken from entity sets2 entities, each taken from entity sets
{({(ee11,, ee22, …, … eenn) |) | ee11 ∈∈ EE11,, ee22 ∈∈ EE22, …,, …, eenn ∈∈ EEnn}}
where (where (ee11,, ee22, …,, …, eenn) is a relationship) is a relationship
 Example:Example:
(Hayes, A-102)(Hayes, A-102) ∈∈ depositordepositor
Relationship Example
7
Attribute of A Relationship Set
8
Relationship
9
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
One-One and One-Many
10
Many-one and many-many
11
1- many
12
Many - 1
13
Many - many
14
Alternative Cardinality Specification
15
Note on Mapping Cardinality
16
Both many and 1 include 0
Meaning some entity may not participate in the relationship
Total Participation
17
•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
Self Relationship
18
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
More examples on self-relationship
19
People to people
Parent – children
Manager – employee
Husband – wife
Word to word
Root – synonym
Attributes
20
Both entity sets and relationships can have attributes
Attributes may be
Composite
Multi-valued (double ellipse)
Derive (dashed ellipse)
Another Example
21
Keys
22
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.
Key Examples
23
Suggest super keys for the following entity?
What are the candidate keys?
Primary key?
author
name
birthday
death
description
Ternary Relationship
24
Can We Decompose a Ternary
Relationship?
25
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?
Converting Ternary to binary
26
 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
Converting Ternary to binary
27
Design an ER Diagram
28
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
Weak Entity Set
29
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
Weak Entity Set Notations
30
Double rectangles for weak entity set
Double diamond for weak entity relationship
Dashed underscore for discriminator
Specialization
31
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
32
Specification
33
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
Design Considerations
34
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
Notations
35
Notations
36
ER Practice Again
37
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.
Best Practice Guide for ER Design
38
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
ER for Banking Enterprise
39
Description handhout
Read ER Diagrams
40
Following are some ER diagrams grabbed from the web
Read to understand/criticize
41
? ? ?
?
?
42
?
43

More Related Content

What's hot

Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
Chirag vasava
 
DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
Bharati Ugale
 
Database systems
Database systemsDatabase systems
Database systems
Dhani Ahmad
 
Dbms architecture
Dbms architectureDbms architecture
Dbms architecture
Shubham Dwivedi
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
Smriti Jain
 
database language ppt.pptx
database language ppt.pptxdatabase language ppt.pptx
database language ppt.pptx
Anusha sivakumar
 
ER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMSER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMS
ssuser20b618
 
3 Tier Architecture
3 Tier Architecture3 Tier Architecture
3 Tier Architecture
guestd0cc01
 
datamarts.ppt
datamarts.pptdatamarts.ppt
datamarts.ppt
bhavyag24
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relationalJafar Nesargi
 
Lesson 02 python keywords and identifiers
Lesson 02   python keywords and identifiersLesson 02   python keywords and identifiers
Lesson 02 python keywords and identifiers
Nilimesh Halder
 
Files Vs DataBase
Files Vs DataBaseFiles Vs DataBase
Files Vs DataBase
Dr. C.V. Suresh Babu
 
Introduction & history of dbms
Introduction & history of dbmsIntroduction & history of dbms
Introduction & history of dbmssethu pm
 
Enhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) ModelingEnhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) Modeling
sontumax
 
Database language
Database languageDatabase language
Architecture of-dbms-and-data-independence
Architecture of-dbms-and-data-independenceArchitecture of-dbms-and-data-independence
Architecture of-dbms-and-data-independenceAnuj Modi
 
Er model ppt
Er model pptEr model ppt
Er model ppt
Pihu Goel
 
3 Level Architecture
3 Level Architecture3 Level Architecture
3 Level Architecture
Adeel Rasheed
 
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
Devashish Kumar
 

What's hot (20)

Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 
DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
 
Database systems
Database systemsDatabase systems
Database systems
 
DBMS Keys
DBMS KeysDBMS Keys
DBMS Keys
 
Dbms architecture
Dbms architectureDbms architecture
Dbms architecture
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
 
database language ppt.pptx
database language ppt.pptxdatabase language ppt.pptx
database language ppt.pptx
 
ER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMSER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMS
 
3 Tier Architecture
3 Tier Architecture3 Tier Architecture
3 Tier Architecture
 
datamarts.ppt
datamarts.pptdatamarts.ppt
datamarts.ppt
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
Lesson 02 python keywords and identifiers
Lesson 02   python keywords and identifiersLesson 02   python keywords and identifiers
Lesson 02 python keywords and identifiers
 
Files Vs DataBase
Files Vs DataBaseFiles Vs DataBase
Files Vs DataBase
 
Introduction & history of dbms
Introduction & history of dbmsIntroduction & history of dbms
Introduction & history of dbms
 
Enhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) ModelingEnhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) Modeling
 
Database language
Database languageDatabase language
Database language
 
Architecture of-dbms-and-data-independence
Architecture of-dbms-and-data-independenceArchitecture of-dbms-and-data-independence
Architecture of-dbms-and-data-independence
 
Er model ppt
Er model pptEr model ppt
Er model ppt
 
3 Level Architecture
3 Level Architecture3 Level Architecture
3 Level Architecture
 
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
 

Viewers also liked

Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)tameemyousaf
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
Mudasir Qazi
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagramTech_MX
 
Entity Relationship Diagram Templates by Creately
Entity Relationship Diagram Templates by CreatelyEntity Relationship Diagram Templates by Creately
Entity Relationship Diagram Templates by Creately
Creately
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
Shakila Mahjabin
 
Sssc2011 ontologies final
Sssc2011 ontologies finalSssc2011 ontologies final
Sssc2011 ontologies finalElena Simperl
 
Er Model Nandha&Mani
Er Model Nandha&ManiEr Model Nandha&Mani
Er Model Nandha&Maniguest1e0229a
 
Entity relationship(er) model
Entity relationship(er) modelEntity relationship(er) model
Entity relationship(er) modelRahul Khanwani
 
85575963 erd
85575963 erd85575963 erd
85575963 erdroohihoor
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
Neil Neelesh
 
03 fsm how_toimplementai_state_20161006_jintaeks
03 fsm how_toimplementai_state_20161006_jintaeks03 fsm how_toimplementai_state_20161006_jintaeks
03 fsm how_toimplementai_state_20161006_jintaeks
JinTaek Seo
 
PHP mysql Er diagram
PHP mysql  Er diagramPHP mysql  Er diagram
PHP mysql Er diagram
Mudasir Syed
 
The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship model
yash patel
 
Desigining of Database - ER Model
Desigining of Database - ER ModelDesigining of Database - ER Model
Desigining of Database - ER Model
Ajay Chhimpa
 
CHAPTER 2 DBMS IN EASY WAY BY MILAN PATEL
CHAPTER 2 DBMS IN EASY WAY BY  MILAN PATELCHAPTER 2 DBMS IN EASY WAY BY  MILAN PATEL
CHAPTER 2 DBMS IN EASY WAY BY MILAN PATEL
Shashi Patel
 
The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship model
Jane Garay
 
Umar Erd
Umar ErdUmar Erd

Viewers also liked (20)

Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagram
 
Entity Relationship Diagram Templates by Creately
Entity Relationship Diagram Templates by CreatelyEntity Relationship Diagram Templates by Creately
Entity Relationship Diagram Templates by Creately
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Sssc2011 ontologies final
Sssc2011 ontologies finalSssc2011 ontologies final
Sssc2011 ontologies final
 
Er Model Nandha&Mani
Er Model Nandha&ManiEr Model Nandha&Mani
Er Model Nandha&Mani
 
Entity relationship(er) model
Entity relationship(er) modelEntity relationship(er) model
Entity relationship(er) model
 
85575963 erd
85575963 erd85575963 erd
85575963 erd
 
1869495 er diagrams
1869495 er diagrams1869495 er diagrams
1869495 er diagrams
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
03 fsm how_toimplementai_state_20161006_jintaeks
03 fsm how_toimplementai_state_20161006_jintaeks03 fsm how_toimplementai_state_20161006_jintaeks
03 fsm how_toimplementai_state_20161006_jintaeks
 
PHP mysql Er diagram
PHP mysql  Er diagramPHP mysql  Er diagram
PHP mysql Er diagram
 
The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship model
 
Ch02 3133
Ch02 3133Ch02 3133
Ch02 3133
 
Desigining of Database - ER Model
Desigining of Database - ER ModelDesigining of Database - ER Model
Desigining of Database - ER Model
 
CHAPTER 2 DBMS IN EASY WAY BY MILAN PATEL
CHAPTER 2 DBMS IN EASY WAY BY  MILAN PATELCHAPTER 2 DBMS IN EASY WAY BY  MILAN PATEL
CHAPTER 2 DBMS IN EASY WAY BY MILAN PATEL
 
The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship model
 
Umar Erd
Umar ErdUmar Erd
Umar Erd
 
E r diagram
E r diagramE r diagram
E r diagram
 

Similar to Entity relationship diagram

ER Model and other topics in DBMS
ER Model and other topics in DBMSER Model and other topics in DBMS
ER Model and other topics in DBMS
HarinarayananR2
 
Test presentation
Test presentationTest presentation
Test presentation
nuvole
 
dbms er model
dbms er modeldbms er model
dbms er model
Surya Swaroop
 
ER model
ER modelER model
ER model
paddu123
 
Er model
Er modelEr model
Er model
paddu123
 
Database Management System
Database Management System Database Management System
Database Management System
FellowBuddy.com
 
1 er
1 er1 er
Unit 3 final.pptx
Unit 3 final.pptxUnit 3 final.pptx
Unit 3 final.pptx
MaximusAranha
 
database.pptx
database.pptxdatabase.pptx
database.pptx
lumaeducation
 
Unit 2 DBMS
Unit 2 DBMSUnit 2 DBMS
Unit 2 DBMS
DhivyaSubramaniyam
 
chap03Corrected.ppt
chap03Corrected.pptchap03Corrected.ppt
chap03Corrected.ppt
MutiaSari53
 
D I T211 Chapter 3
D I T211    Chapter 3D I T211    Chapter 3
D I T211 Chapter 3askme
 
U2_ER_modeling.pptx
U2_ER_modeling.pptxU2_ER_modeling.pptx
U2_ER_modeling.pptx
ssusera7b660
 
ER diagram - Krishna Geetha.ppt
ER diagram - Krishna Geetha.pptER diagram - Krishna Geetha.ppt
ER diagram - Krishna Geetha.ppt
ComputerScienceDepar6
 
Administrator of Online Examination has multiple features such as Add, Delete...
Administrator of Online Examination has multiple features such as Add, Delete...Administrator of Online Examination has multiple features such as Add, Delete...
Administrator of Online Examination has multiple features such as Add, Delete...
ayushi296420
 

Similar to Entity relationship diagram (20)

ER Model and other topics in DBMS
ER Model and other topics in DBMSER Model and other topics in DBMS
ER Model and other topics in DBMS
 
Test presentation
Test presentationTest presentation
Test presentation
 
dbms er model
dbms er modeldbms er model
dbms er model
 
dbms
dbmsdbms
dbms
 
ER model
ER modelER model
ER model
 
Er model
Er modelEr model
Er model
 
Database Management System
Database Management System Database Management System
Database Management System
 
L7 er2
L7 er2L7 er2
L7 er2
 
1 er
1 er1 er
1 er
 
Unit 3 final.pptx
Unit 3 final.pptxUnit 3 final.pptx
Unit 3 final.pptx
 
database.pptx
database.pptxdatabase.pptx
database.pptx
 
Er
ErEr
Er
 
Unit 2 DBMS
Unit 2 DBMSUnit 2 DBMS
Unit 2 DBMS
 
chap03Corrected.ppt
chap03Corrected.pptchap03Corrected.ppt
chap03Corrected.ppt
 
27 fcs157al3
27 fcs157al327 fcs157al3
27 fcs157al3
 
D I T211 Chapter 3
D I T211    Chapter 3D I T211    Chapter 3
D I T211 Chapter 3
 
Unit02 dbms
Unit02 dbmsUnit02 dbms
Unit02 dbms
 
U2_ER_modeling.pptx
U2_ER_modeling.pptxU2_ER_modeling.pptx
U2_ER_modeling.pptx
 
ER diagram - Krishna Geetha.ppt
ER diagram - Krishna Geetha.pptER diagram - Krishna Geetha.ppt
ER diagram - Krishna Geetha.ppt
 
Administrator of Online Examination has multiple features such as Add, Delete...
Administrator of Online Examination has multiple features such as Add, Delete...Administrator of Online Examination has multiple features such as Add, Delete...
Administrator of Online Examination has multiple features such as Add, Delete...
 

Recently uploaded

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
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
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
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
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
 
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
 
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)
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
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
 
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
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
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
 
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
 
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
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
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
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 

Recently uploaded (20)

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
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.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
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
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
 
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
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
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.
 
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
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.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
 
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
 
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...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 

Entity relationship diagram

  • 2. ER 2 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. Basic Concepts 3 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
  • 5. Relationship 5 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. Relationship 6  AA relationshiprelationship setset is a mathematical relation amongis a mathematical relation among nn ≥≥ 2 entities, each taken from entity sets2 entities, each taken from entity sets {({(ee11,, ee22, …, … eenn) |) | ee11 ∈∈ EE11,, ee22 ∈∈ EE22, …,, …, eenn ∈∈ EEnn}} where (where (ee11,, ee22, …,, …, eenn) is a relationship) is a relationship  Example:Example: (Hayes, A-102)(Hayes, A-102) ∈∈ depositordepositor
  • 8. Attribute of A Relationship Set 8
  • 9. Relationship 9 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
  • 16. Note on Mapping Cardinality 16 Both many and 1 include 0 Meaning some entity may not participate in the relationship
  • 17. Total Participation 17 •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. Self Relationship 18 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. More examples on self-relationship 19 People to people Parent – children Manager – employee Husband – wife Word to word Root – synonym
  • 20. Attributes 20 Both entity sets and relationships can have attributes Attributes may be Composite Multi-valued (double ellipse) Derive (dashed ellipse)
  • 22. Keys 22 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. Key Examples 23 Suggest super keys for the following entity? What are the candidate keys? Primary key? author name birthday death description
  • 25. Can We Decompose a Ternary Relationship? 25 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. Converting Ternary to binary 26  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
  • 28. Design an ER Diagram 28 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. Weak Entity Set 29 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. Weak Entity Set Notations 30 Double rectangles for weak entity set Double diamond for weak entity relationship Dashed underscore for discriminator
  • 31. Specialization 31 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
  • 32. 32
  • 33. Specification 33 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. Design Considerations 34 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
  • 37. ER Practice Again 37 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. Best Practice Guide for ER Design 38 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. ER for Banking Enterprise 39 Description handhout
  • 40. Read ER Diagrams 40 Following are some ER diagrams grabbed from the web Read to understand/criticize
  • 42. 42 ?
  • 43. 43