0

I just read this: What's the difference between identifying and non-identifying relationships?

And the example for a non-identifying relationship there sounds like it should be a many to many table. One person can have multiple states and one state can be used by many persons.

And I can't really think of an example where a non-identifying relationship should not be a ManyToMany relationship.

So, can someone elaborate on this? Because I can't come up with any examples that go against this.

EDIT:

For example, an identifying relationship would be an appletree having apples. Those apples got spawned because of the appletree. So the appletree has many apples but each apple belongs only to that one tree.

A non-identifying OneToMany relationship would then have to have something that spawned independently, but can only ever belong to one other thing. Because if it belongs to multiple things that themselves have multiple instances...

Hang on I just realized the case where the instance A can have only one instance of B but one B can be linked to multiple A's, while B got created independently.

Case closed I guess.

Community
  • 1
  • 1
KdgDev
  • 14,299
  • 46
  • 120
  • 156

1 Answers1

0

non-identifying OneToMany relationship, is a OneToMany relationship.

On the other side: A identifying OneToMany relationship could be inverted into a OneToOne relationship.

Example: Person X has phonenumber 123456. Although in the table "Phones" many phonenumbers are present, phonenumber 123456 is probably only present once. So this phonenumber identifies person X. Although Person X can have multiple phones, the "Many" side is almost a unique identifier and thus a sort of "one-to-one" relationship.

Example of Non-identifying: Person X lives in Canada. If you search on Canada, you will find many persons (probably). But if you revert this query, a lookup on Canada, it's not a manytomany, but a onetomany relationship.

PSVSupporter
  • 248
  • 3
  • 16
  • I now see you closed your own case :D. – PSVSupporter May 01 '15 at 13:11
  • Doesn't OneToOne imply both sides can only ever have one? – KdgDev May 04 '15 at 12:55
  • Yes it does. I don't mean it is a real one-to-one relation ship, but sort of. Probably your phone number is only being used by yourself, so in the table your phone number is present only once. That's why I say 'sort of' one-to-one relationship. – PSVSupporter May 06 '15 at 13:56