SlideShare a Scribd company logo
1 of 19
ERD Optionality
OOD Inge Powell
ERD Optionality
 When

we show relationships between
tables as well as the cardinality we also
need to show the optionality.
 Depending on the data we are storing
there are several options to choose
from.
 If using Visio to create a diagram, it
takes its initial value from the database
store.
ERD Optionality
 The

cardinality shows what type of relation
ship, (One to One or One to Many etc)
 But is does not state whether this is a
mandatory or optional relationship.
A

Mandatory relationship is where there must
be at least one matching record in each entity.
 An Optional relationship is where there may
or may not be a matching record in each
entity.
ERD Optionality
 The

relationship is shown with a
connecting line between the entities.
Entity A

Entity B

 The

cardinality is shown by the use of
crows feet or lines.
Entity A

 But

Entity B

is does not state whether this is a
mandatory or optional relationship?
ERD Optionality
 The

optionality is shown inside the
cardinality.
Cardinality

Entity A

Entity B

Optionality
ERD Optionality
A Mandatory relationship is shown with a
vertical line next to the cardinality. (Must
be at least one Entity A)
Entity A

 An

Optional relationship is shown with a
hollow circle next to the cardinality
(There maybe 0 to many of Entity B
Entity B
ERD Optionality


There are several types. Consider the optionality of
the next few examples when combined with
cardinality.
Entity

At least one entity.
Entity

None or one entity.

Entity

One and only one entity.
Entity

May be none or one or
more than one entity.
ERD Optionality
 Here

are some Mandatory examples..
Customer

 One

Customer has made at least one order.
Customer

 One

Order

Order

Order is for Only One Customer
ERD Optionality
 Here

are some Optional examples..
Protected
Species

Reptile

 One

Protected Species record may be for
none, one or many kept reptiles.
Protected
Species

 One

Reptile

Reptile may or may not have a protected
species record.
ERD Optionality
 Here

are some Mixed examples.
Category

Product

 One

Category may have none, one or many
Products.
Category

 One

Product

Product will have one and only one
Category.
ERD Optionality



Very rarely there is a optional mandatory relationship.
This is usually where there are several tables
concerned. This is a mutually exclusive relationship.
Bus
MOT
Minibus





A Bus will have one or more MOT records.
A Minibus will have one or more MOT records.
An MOT record MUST be for either a bus or a
minibus. It must be for at least One of the entities.
ERD Optionality
 Scenario:
A

small hire car firm has several cars.
 The company ensures that the cars they
buy have an initial service.
 Each car is serviced regularly.
 Records are kept of each car and each
service.
Car

Service
ERD Optionality
 In

the scenario, there will always be at
least one service record for a car.
 If a service has been recorded then it
must have a matching car record.
 This

is a Mandatory relationship.
Will have at least one

Car

Service
Will have a matching car
Erd Optionality
 We

add in the optionality.
Car

Service

 One

Car has one or more Service records.
 One Service record is for only one Car record.
 The records might be held like this:
Car
Car

PK CarID
PK CarID
Make
Make
Model
Model

EngineCC
EngineCC

Service
Service

PK ServiceID
PK ServiceID
Date
Date
Garage
Garage
FK CarID
FK CarID
ERD Optionality
 Look

at all of your relationships in turn.
Entity A

 This

Entity B

is a ‘One to Many’ relationship.
 Ask yourself, Does Entity A, HAVE to have an
Entity B?
 If it does, then place a single vertical line next
to the crows feet of Entity B.
 If it does not, then place a circle by the crows
feet of Entity B.
ERD Optionality
 Entity

A DOES have to have at least 1 Entity B
Entity A

 Entity

Entity B

A does NOT have to have an Entity B.
Entity A

Entity B
ERD Optionality
 Lets

say you decided that it could be optional.
 Now look at the reverse relationship.
Entity A

 Ask

Entity B

yourself, Does Entity B, HAVE to have an
Entity A?
 If it does, then place another vertical line next
to the cardinality of Entity A.
 If it does not, then place a circle by Entity A.
ERD Optionality
 Entity

B DOES have to have an Entity A
Entity A

 Entity

Entity B

B does NOT have to have an Entity A.
Entity A

Entity B
Erd Optionality
 Visio

will pick up the relationship types from
the database structure.
Customer

 If

?
??
?

Order

it is not showing the optionality correctly, then
the issue is in the database relationships.
 A One To Many relationship will give an optional
link as default.
 You must set Referential Integrity to true and
correctly set the Join type.

More Related Content

What's hot

4.2. Operasi Dasar Singly Linked List 2 (primitive list)
4.2. Operasi Dasar Singly Linked List  2 (primitive list)4.2. Operasi Dasar Singly Linked List  2 (primitive list)
4.2. Operasi Dasar Singly Linked List 2 (primitive list)Kelinci Coklat
 
Part 7 - Mengenal Array di Visual Basic .Net
Part 7 - Mengenal Array di Visual Basic .NetPart 7 - Mengenal Array di Visual Basic .Net
Part 7 - Mengenal Array di Visual Basic .NetRolly Yesputra
 
Software requirementspecificationsrs
Software requirementspecificationsrsSoftware requirementspecificationsrs
Software requirementspecificationsrsFajar DQ
 
pertemuan 7 basis data relational.ppt
pertemuan 7 basis data relational.pptpertemuan 7 basis data relational.ppt
pertemuan 7 basis data relational.pptbagjanugraha15
 
Presentation on Relational Schema (Database)
Presentation on Relational Schema (Database)Presentation on Relational Schema (Database)
Presentation on Relational Schema (Database)Salim Hosen
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagramssadique_ghitm
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mappingsaurabhshertukde
 
entity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptentity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptIRWANBINISMAILKPMGur1
 
Laporan praktikum modul 4 (e-rd notasi martin)
Laporan praktikum modul 4 (e-rd notasi martin)Laporan praktikum modul 4 (e-rd notasi martin)
Laporan praktikum modul 4 (e-rd notasi martin)Devi Apriansyah
 
Mapping ER and EER Model
Mapping ER and EER ModelMapping ER and EER Model
Mapping ER and EER ModelMary Brinda
 
Chapter-2 Database System Concepts and Architecture
Chapter-2 Database System Concepts and ArchitectureChapter-2 Database System Concepts and Architecture
Chapter-2 Database System Concepts and ArchitectureKunal Anand
 
E-R diagram in Database
E-R diagram in DatabaseE-R diagram in Database
E-R diagram in DatabaseFatiha Qureshi
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship ModellingBhandari Nawaraj
 

What's hot (20)

ER MODEL
ER MODELER MODEL
ER MODEL
 
4.2. Operasi Dasar Singly Linked List 2 (primitive list)
4.2. Operasi Dasar Singly Linked List  2 (primitive list)4.2. Operasi Dasar Singly Linked List  2 (primitive list)
4.2. Operasi Dasar Singly Linked List 2 (primitive list)
 
Part 7 - Mengenal Array di Visual Basic .Net
Part 7 - Mengenal Array di Visual Basic .NetPart 7 - Mengenal Array di Visual Basic .Net
Part 7 - Mengenal Array di Visual Basic .Net
 
Software requirementspecificationsrs
Software requirementspecificationsrsSoftware requirementspecificationsrs
Software requirementspecificationsrs
 
Asp.net validation
Asp.net validationAsp.net validation
Asp.net validation
 
pertemuan 7 basis data relational.ppt
pertemuan 7 basis data relational.pptpertemuan 7 basis data relational.ppt
pertemuan 7 basis data relational.ppt
 
Presentation on Relational Schema (Database)
Presentation on Relational Schema (Database)Presentation on Relational Schema (Database)
Presentation on Relational Schema (Database)
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mapping
 
entity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptentity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.ppt
 
Laporan praktikum modul 4 (e-rd notasi martin)
Laporan praktikum modul 4 (e-rd notasi martin)Laporan praktikum modul 4 (e-rd notasi martin)
Laporan praktikum modul 4 (e-rd notasi martin)
 
Mapping ER and EER Model
Mapping ER and EER ModelMapping ER and EER Model
Mapping ER and EER Model
 
Normalisasi data
Normalisasi dataNormalisasi data
Normalisasi data
 
Linked list
Linked listLinked list
Linked list
 
AI_20111003
AI_20111003AI_20111003
AI_20111003
 
Chapter-2 Database System Concepts and Architecture
Chapter-2 Database System Concepts and ArchitectureChapter-2 Database System Concepts and Architecture
Chapter-2 Database System Concepts and Architecture
 
Normalisasi Data
Normalisasi DataNormalisasi Data
Normalisasi Data
 
E-R diagram in Database
E-R diagram in DatabaseE-R diagram in Database
E-R diagram in Database
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
 
Controls
ControlsControls
Controls
 

Recently uploaded

Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 

Recently uploaded (20)

Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 

Erd optionality

  • 2. ERD Optionality  When we show relationships between tables as well as the cardinality we also need to show the optionality.  Depending on the data we are storing there are several options to choose from.  If using Visio to create a diagram, it takes its initial value from the database store.
  • 3. ERD Optionality  The cardinality shows what type of relation ship, (One to One or One to Many etc)  But is does not state whether this is a mandatory or optional relationship. A Mandatory relationship is where there must be at least one matching record in each entity.  An Optional relationship is where there may or may not be a matching record in each entity.
  • 4. ERD Optionality  The relationship is shown with a connecting line between the entities. Entity A Entity B  The cardinality is shown by the use of crows feet or lines. Entity A  But Entity B is does not state whether this is a mandatory or optional relationship?
  • 5. ERD Optionality  The optionality is shown inside the cardinality. Cardinality Entity A Entity B Optionality
  • 6. ERD Optionality A Mandatory relationship is shown with a vertical line next to the cardinality. (Must be at least one Entity A) Entity A  An Optional relationship is shown with a hollow circle next to the cardinality (There maybe 0 to many of Entity B Entity B
  • 7. ERD Optionality  There are several types. Consider the optionality of the next few examples when combined with cardinality. Entity At least one entity. Entity None or one entity. Entity One and only one entity. Entity May be none or one or more than one entity.
  • 8. ERD Optionality  Here are some Mandatory examples.. Customer  One Customer has made at least one order. Customer  One Order Order Order is for Only One Customer
  • 9. ERD Optionality  Here are some Optional examples.. Protected Species Reptile  One Protected Species record may be for none, one or many kept reptiles. Protected Species  One Reptile Reptile may or may not have a protected species record.
  • 10. ERD Optionality  Here are some Mixed examples. Category Product  One Category may have none, one or many Products. Category  One Product Product will have one and only one Category.
  • 11. ERD Optionality   Very rarely there is a optional mandatory relationship. This is usually where there are several tables concerned. This is a mutually exclusive relationship. Bus MOT Minibus    A Bus will have one or more MOT records. A Minibus will have one or more MOT records. An MOT record MUST be for either a bus or a minibus. It must be for at least One of the entities.
  • 12. ERD Optionality  Scenario: A small hire car firm has several cars.  The company ensures that the cars they buy have an initial service.  Each car is serviced regularly.  Records are kept of each car and each service. Car Service
  • 13. ERD Optionality  In the scenario, there will always be at least one service record for a car.  If a service has been recorded then it must have a matching car record.  This is a Mandatory relationship. Will have at least one Car Service Will have a matching car
  • 14. Erd Optionality  We add in the optionality. Car Service  One Car has one or more Service records.  One Service record is for only one Car record.  The records might be held like this: Car Car PK CarID PK CarID Make Make Model Model EngineCC EngineCC Service Service PK ServiceID PK ServiceID Date Date Garage Garage FK CarID FK CarID
  • 15. ERD Optionality  Look at all of your relationships in turn. Entity A  This Entity B is a ‘One to Many’ relationship.  Ask yourself, Does Entity A, HAVE to have an Entity B?  If it does, then place a single vertical line next to the crows feet of Entity B.  If it does not, then place a circle by the crows feet of Entity B.
  • 16. ERD Optionality  Entity A DOES have to have at least 1 Entity B Entity A  Entity Entity B A does NOT have to have an Entity B. Entity A Entity B
  • 17. ERD Optionality  Lets say you decided that it could be optional.  Now look at the reverse relationship. Entity A  Ask Entity B yourself, Does Entity B, HAVE to have an Entity A?  If it does, then place another vertical line next to the cardinality of Entity A.  If it does not, then place a circle by Entity A.
  • 18. ERD Optionality  Entity B DOES have to have an Entity A Entity A  Entity Entity B B does NOT have to have an Entity A. Entity A Entity B
  • 19. Erd Optionality  Visio will pick up the relationship types from the database structure. Customer  If ? ?? ? Order it is not showing the optionality correctly, then the issue is in the database relationships.  A One To Many relationship will give an optional link as default.  You must set Referential Integrity to true and correctly set the Join type.