0

I don't understand this table from Wikipedia completely:

row1 1      1   one-to-one                               person ←→ weight
row2 0..1   1   optional on one side one-to-one          date of birth ←→ person
row3 0..*   0..* optional on both sides many-to-many     person ←→ book
row4 1      1..* many-to-one                             person ←→ birth place

row2: I think every person has exactly one date of birth. I don't understand this

row4: I think every person has exactly one birth place. I don't understand this.

What am I missing?

2

The Wikipedia examples are not the best.

  1. Relationships are between entities. The person <-> weight is a poor examples of a 1-1 relationship because weight is not an entity but an attribute. A better example might be employee <-> cube (assuming one-person cubes). Each employee is assigned one and only one cube and each cube be is assigned to one and only one employee.

    In practice, there are few places where you will find 1-1 relationships between tabled entities. You might find them for some PII data that is moved to a separate table for security reasons.

  2. Again a poor example and for the same reason: a date is an attribute, not an entity. Use again the employee <-> Cube number example. The optional quality is imparted by making the Cube number field nullable, meaning the cube may not apply or may not be known, at least at the time the record was created. However, it makes more sense to have the optional component on the cube side as a cube could well be empty, not assigned to any employee.

  3. A better example. A person may be the author of 0, 1 or many books and a book may be authored by 0 (such as a phone book), 1 or many authors. The optional quality on either side could also mean the data is just not known.

  4. Also a fairly good example. A person can only be born in one and only one place -- say, a city. A city, however, can be the birthplace of many people.

  • 1
    it took some time for me to understand "cube" in this context. I though you mean the mathematical object. I guess you mean the work place. I Germany (my location) cubes are not wide spread. To "entity vs attribute": for me this does not play a big role. The page is about cardinality. This is data modeling, not about relational databases. Don't get me wrong: I am happy that you replied. The question for me is now: how to improve the article. For me cardinality is an important basic of computer science. – guettli Sep 16 '16 at 7:38
  • 1
    I sometimes forget this site serves an international audience. I should said cubical or office. Other than the confusion with the word "cube" what more would be needed to improve the article? Do you still have any questions about cardinality? – TommCatt Sep 18 '16 at 5:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.