Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
ERD Optionality
OOD Inge Powell
ERD Optionality
 When

we show relationships between
tables as well as the cardinality we also
need to show the optionali...
ERD Optionality
 The

cardinality shows what type of relation
ship, (One to One or One to Many etc)
 But is does not sta...
ERD Optionality
 The

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

Entity B

 The

cardi...
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 Enti...
ERD Optionality


There are several types. Consider the optionality of
the next few examples when combined with
cardinali...
ERD Optionality
 Here

are some Mandatory examples..
Customer

 One

Customer has made at least one order.
Customer

 O...
ERD Optionality
 Here

are some Optional examples..
Protected
Species

Reptile

 One

Protected Species record may be fo...
ERD Optionality
 Here

are some Mixed examples.
Category

Product

 One

Category may have none, one or many
Products.
C...
ERD Optionality



Very rarely there is a optional mandatory relationship.
This is usually where there are several table...
ERD Optionality
 Scenario:
A

small hire car firm has several cars.
 The company ensures that the cars they
buy have an...
ERD Optionality
 In

the scenario, there will always be at
least one service record for a car.
 If a service has been re...
Erd Optionality
 We

add in the optionality.
Car

Service

 One

Car has one or more Service records.
 One Service reco...
ERD Optionality
 Look

at all of your relationships in turn.
Entity A

 This

Entity B

is a ‘One to Many’ relationship....
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...
ERD Optionality
 Lets

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

 Ask...
ERD Optionality
 Entity

B DOES have to have an Entity A
Entity A

 Entity

Entity B

B does NOT have to have an Entity ...
Erd Optionality
 Visio

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

 If

?
??
?

Order

i...
Upcoming SlideShare
Loading in …5
×

18

Share

Download to read offline

Erd optionality

Download to read offline

Related Books

Free with a 30 day trial from Scribd

See all

Erd optionality

  1. 1. ERD Optionality OOD Inge Powell
  2. 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. 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. 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. 5. ERD Optionality  The optionality is shown inside the cardinality. Cardinality Entity A Entity B Optionality
  6. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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.
  • abodiab1111

    Aug. 3, 2020
  • MoonBahadur

    Jul. 18, 2020
  • GihanPriyankara

    Aug. 16, 2019
  • JAAFARYUSUF

    Jun. 4, 2019
  • ShakhayatHossain1

    Mar. 13, 2019
  • karyadel

    Nov. 21, 2018
  • YarZarTun2

    Oct. 31, 2018
  • PeterNjoroge35

    Jul. 11, 2018
  • GabrielGutierrez126

    Jun. 3, 2018
  • DerekDoucette2

    Apr. 2, 2018
  • ggurklys

    Feb. 21, 2018
  • AhmedAttya5

    Dec. 27, 2017
  • rdivecha

    Jan. 23, 2017
  • NeChelleWhitehurst

    Jul. 12, 2016
  • marxtom

    Apr. 13, 2016
  • mrsalah2012

    Oct. 5, 2015
  • BrianWright10

    May. 24, 2015
  • DavidN929

    Apr. 2, 2015

Views

Total views

37,881

On Slideshare

0

From embeds

0

Number of embeds

66

Actions

Downloads

415

Shares

0

Comments

0

Likes

18

×