views:

1732

answers:

2

I've read this question: http://stackoverflow.com/questions/762937/whats-the-difference-between-identifying-and-non-identifying-relationships

But I'm still not too sure... What I have is three tables.

  1. Users
  2. Objects
  3. Pictures

A user can own many objects and can also post many pictures per individual object. My gut feeling tells me this is an identifying relationship, because I'll need the userID in the objects table and I'll need the objectID in the pictures tables...

Or am I wrong? The explanations in the other topic limit themselves to the theoretical explanation of the way the database interprets it after it's already been coded, not how the objects are connected in real life. I'm kinda confused as to how to make the decision of identifying versus non-identifying when thinking about how I'm going to build the database.

+6  A: 

Both sound like identifying relationships to me. If you have heard the terms one-to-one or one-to-many, and many-to-many, one-to- relationships are identifying relationships, and many-to-many relationships are non-identifying relationships.

  • If the child identifies its parent, it is an identifying relationship. In the link you have given, if you have a phone number, you know who it belongs to (it only belongs to one).

  • If the child does not identify its parent, it is a non-identifying relationship. In the link, it mentions states. Think of a state as a row in a table representing mood. "Happy" doesn't identify a particular person, but many people.

Edit: Other real life examples:

  • A physical address is a non-identifying relationship, because many people may reside at one address. On the other hand, an email address is (usually considered) an identifying relationship.
  • A Social Security Number is an identifying relationship, because it only belongs to one person
  • Comments on Youtube videos are identifying relationships, because they only belong to one video.
  • An original of a painting only has one owner (identifying), while many people may own reprints of the painting (non-identifying).
Renesis