• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

One to many relationship

 
Roshan Eranga Fernando
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hi everyone,

Its awkward for me that in X-Y relationship says that it can have zero instance and in Y-X relationship mentions that can have only one instance(cannot have zero instance)
can anybody explain the database logical, applied in here?
 
Campbell Ritchie
Sheriff
Posts: 51332
86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's call fatherhood a "Man-child" relationship. It is 1..n

A man can have several children. A man can have one child. A man might not have any children. So he can have n or 1 or 0.
A child can have one father. No child can have 0 fathers (even though the father might have died, or something). No child can have 2 or 3 fathers. So the child can have 1 or 1 or 1.

Relational databases work well with 1..n relations throughout.
 
Stephan Mueller
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's call fatherhood a "Man-child" relationship

Where 'Man' is the X entity and 'child' is the Y entity, therefor X-Y Relationship (and vice versa)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic