Crow's Feet - One vs One And Only One

Data Modeling

Data Modeling Problem Overview


What is the difference between

ONE: One

ONE AND ONLY ONE: One And Only One

Data Modeling Solutions


Solution 1 - Data Modeling

I think n.piskunov is on the right track.

I would use it as the mathematical analogy found here: https://math.stackexchange.com/questions/247380/analogy-between-one-and-only-one-and-if-and-only-if

"existence of at most one such X that satisfies Y."

As an example, consider these relations: enter image description here

A student, Alice, can only have one dorm room at at time. A dorm room can only house one student at a time (for the sake of this example). Next year, Alice will be assigned a new dorm room, and at that point her dorm room from this year will be assigned to a new student.

Alice can have one and only one login (e.g. a11235) and that login can only be assigned to Alice. When Alice graduates, no one else can be assigned the login a11235.

Solution 2 - Data Modeling

In my opinion the difference is:

enter image description here

  • Red entity (king's palace) is related to single inhabitant - Prince Arthur. There are no other inhabitants, who may live in palace, except Arthur. But relation type is still Many-to-one (many palaces to single inhabitant)

  • But, any inhabitant may have a horse(s). Relation is, again, many-to-one (many horses to definite inhabitant), but behaves differently. (Knights are also allowed to own a horse).

Solution 3 - Data Modeling

dosenmatter is correct

To be specific with the notation, always use two signs:

  1. The one closest to the table
  • This is the cardinality
  • It says if there can be one or many (line or crows feet)
  1. The other one
  • This is the modality (aka ordinality)
  • It says if the minimum can be zero or one (ring or line)

If there is only a single line, this only means that we don't know if there could be "zero or one" or "one and only one".

Solution 4 - Data Modeling

According to this answer to another question about differences in crow's feet notation, it says "one" and "many" are ambiguous.

Wikipedia also uses the double bar, "one and only one" for one artist performing many songs. This doesn't match with the accepted solution, because it doesn't mean that one artist performs all songs like how king arthur inhabits all palaces. It also doesn't match valem's solution, because an artist isn't tied to one song and can be reassigned to other songs.

My conclusion, is that "many" can mean "zero or many" or "one or many" because it is ambiguous on purpose. You are leaving it unspecified because you don't know or don't care at this point in time. Similarly, "one" can mean "zero or one" or "one or only one". See how in both notations, being specific is just specifying the lower bound as 0 or 1.

So in summary,

  • use "zero or one" if it can be 0 or 1, {0, 1}
  • use "one and only one" if it can be 1, {1}
  • use "one" if it can be "zero or one" or "one and only one", {0, 1} ∪ {1}

If you think about it, "one" === "zero or one" since {0, 1} is a superset of {1} and {0, 1} ∪ {1} === {0, 1}.

I think the notation is designed like this just to parallel the "many" notation. Also, just to explicitly say you are being nonspecific about the lower bound.

Solution 5 - Data Modeling

  1. Use the "one and only one" when you're absolutely sure it's a singular relationship. Your completed diagram should have this notation since it's more specific.
  2. Use the "one" notation if you know you want some sort of single relationship, but you're not completely sure which yet. Maybe you're concepting an idea within an ERD and you're pretty confident it's some sort of "one" relationship, but you have some kinks to work out before you know if it's a "zero or one" or a "one and only one" or a "one or many" relationship. In that scenario, just put the singular "one" notation and figure out your exact mins and maxes later.

Solution 6 - Data Modeling

One and Only One is used for cardinality. I don't think One alone can be used for cardinality in crow foot. Source

Solution 7 - Data Modeling

I think the one (and only one) difference between "one" and "one(and only one)" relationships is of uniqueness.

A non-transferable airline flight ticket PNR is issued to, let's say, 'Alice (and only Alice)' and is not transferable to any other person but a movie ticket ID is issued to (and held by at any time) "one" person but can be transferred/sold to another person before entering the movie theater.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAtron SeigeView Question on Stackoverflow
Solution 1 - Data ModelingvalemView Answer on Stackoverflow
Solution 2 - Data Modelingn.prokhorovView Answer on Stackoverflow
Solution 3 - Data Modelinguser3114859View Answer on Stackoverflow
Solution 4 - Data ModelingdosentmatterView Answer on Stackoverflow
Solution 5 - Data ModelingspectralLightView Answer on Stackoverflow
Solution 6 - Data Modelinguser3048613View Answer on Stackoverflow
Solution 7 - Data ModelingChan0017View Answer on Stackoverflow