0

I've been wondering if there is any standard for the "entity relationship model".

A lot of well known books that I've read are missing some scenarios that can happen.

here are some scenarios..

  1. I've not found book that says anything about whether or not a descriptive attribute of relationship set can be part of the primary key of the relationship set.

  2. I've not found a book that says whether or not a superclass can be a weak entity set, and if so what is the notional convention for such thing ? do the subclasses also have a double rectangle indicating that it's a weak entity set ?

  3. is it legit to have aggregation within aggregation ?

  4. can an entity set form a distinct relationship with an entity set that is inside a border indicating an aggregation ? here is an example

enter image description here

Basically in the diagram we have Worker and Manager and they both work together on some projects, the Manager may make an evaluation report on the worker at the specific Project they are working on.

So I need to apply the aggregation concept for that scenario.

but here is the thing, i want Worker and Manager entity sets to participate on different relationships as well that are not part of the aggregation.

i don't want to limit them. now I realized that i want them to be a subclasses of a Person

and i want that Person to participate in a recursive relationship set "parent_of" that basically indicate the parent of that Person.

as we know that mean that Also Worker and Manager participate on that relationship because they are subclasses of Person.

But I just don't know if it's "legit" to do that and other things i've mentioned, because they never talked whether it's possible or not on the books.

So is there any well written standard where I can have a detailed information about the "entity relationship model"?

Thanks in advance !

AngryJohn
  • 576
  • 4
  • 10
  • 2
    _"...are missing some scenarios that can happen."_ - examples? – Dai Aug 21 '22 at 04:06
  • Have you ever read [Codd's paper](https://www.seas.upenn.edu/~zives/03f/cis550/codd.pdf)? – Dai Aug 21 '22 at 04:07
  • What scenarios? – The Impaler Aug 21 '22 at 04:10
  • @Dai here's some scenarios – AngryJohn Aug 21 '22 at 15:09
  • _"So I need to apply the aggregation concept for that scenario."_ - what do you mean by "aggregation concept"? – Dai Aug 21 '22 at 15:21
  • _"now I realized that i want them to be a subclasses of a Person"_ - **bzzzzt!** _nope_: OOP concepts like subclassees and inheritance [do not belong in RDBMS databases](https://en.wikipedia.org/wiki/Object%E2%80%93relational_impedance_mismatch), and don't make the common mistake of using inheritance to model people (e.g. `class Person {}`, `class Employee : Person {}`) because outside trivial toy examples [_it doesn't work_](https://softwareengineering.stackexchange.com/questions/436738/why-is-inheritance-bad-in-a-person-student-model)) – Dai Aug 21 '22 at 15:23
  • Also, read this: https://boxbase.org/entries/2020/aug/3/case-against-oop/ – Dai Aug 21 '22 at 15:23
  • _"and i want that Person to participate in a recursive relationship set "parent_of" that basically indicate the parent of that Person."_ - be careful: RDBMS (admittantly) aren't _that_ good at modelling hierarchical relationships - this is due to a shortcoming in Codd's original relational calculus. – Dai Aug 21 '22 at 15:27
  • _"as we know that mean that Also Worker and Manager participate on that relationship because they are subclasses of Person."_ - this is why you should not be thinking of OOP concepts when designing a database. – Dai Aug 21 '22 at 15:28
  • @TheImpaler i've added the scenarios – AngryJohn Aug 21 '22 at 17:16
  • @Dai "what do you mean by aggregation concept" it's an idea related to the ER Model. i think you misunderstood the question here. I'm talking about the ER Model not the Relational Model – AngryJohn Aug 21 '22 at 17:34
  • @AngryJohn _"I'm talking about the ER Model not the Relational Model"_ - yes, I know. – Dai Aug 21 '22 at 17:35
  • Here my two cents: 1) Safe for the concept of natural keys (that I would strongly recommend to avoid using) key values should not convey any kind of information for the entity. Since an attribute *is* information of the entity, it should not be part of a key. – The Impaler Aug 21 '22 at 19:54
  • 2) Inheritance is not part of the relational model and, therefore, it's not defined as an integral part of an ER. There are six ways of modelling inheritance in an ER and, of course, you can **render** your inheritance into any of those models. However, you cannot formally stipulate the inheritance in an ER. – The Impaler Aug 21 '22 at 19:58
  • 3) One-to-Many relationships ar an integral part of the relational model. You can have multiple relationships between each pair of entities. There's no limitation on how many one-to-many relationships the model can have, reflexives or not. "Aggregations" usually refer to the querying of the data; this, is not part of relational algebra, however. – The Impaler Aug 21 '22 at 20:02

0 Answers0