4
votes

I have to describe shareholdings, where a subject has a shareholding in an investee company and the shareholding is described by zero or more records.

I don't know what is the correct way to model the "shareholding" part. It sounds like a relationship, but it seems also an entity.

Both diagram 1 and diagram 2 lead to the same logical schema, if I'm not wrong.

Which diagram do you think is the correct one? The first or the second? And why?

And, are the second and the third schema equivalent? (my answer is: yes)

Schema 1:

schema1

Schema 2:

enter image description here

Schema 3:

enter image description here

1

1 Answers

2
votes

First, to address whether or not shareholding is an entity or a relationship: Because shareholding describes how a subject and an investee company interact, I'm inclined to think it's a relationship. That being said, you may want to define shareholding between the subjects + records and the investee company very explicitly.

Second, about which schema is correct: I think to correctly show that shareholding can be describes by zero or more records, 2 and 3 cannot be correct as those have a (1,1) relationship between the Shareholding and Record entities. Personally I would modify Schema 1 to have Shareholding as a relationship shared by Investee and Shareholder, and then have a (0,N) connection between Shareholding and Record directly (if possible). This would show the actual relationship between the two, rather than a middle-man Descriptions relationship, but may be off on how these things interact in your system, so that's your call on what makes the most sense. :)

I'll also say that I like the (0,N) between Subject and Shareholding in Schema 2.

Third, on if Schema 2 and Schema 3 are equivalent: Yes, these are equivalent, because you kept the Shareholder and Investee relationships consistent in the two. If you'd changed them to entities in Schema 3 the scenario would have been different, but in Schema 3 you pretty much just made it more explicit what Shareholding is. That being said, Schema 2 is much more clear.

I hope this helps! I'm by no means a master of ERDs and happy to discuss this if you want! :)