sql - Relational Data: entity inheritance approaches. Best practice -


There are several ways to store the hierarchy of entities in a relation database

For example, Unit is 20 basic characteristics), student unit (same as person but many new specific areas are present), employee (similar to person but some new areas are present) etc.

When you use Advice to do (and not to use) the following data model C view:

  • A large table with all possible areas + person type marker field (student or employee)
  • Part in the table
  • Some other but also relational ...

Thanks in advance!

A database model does not have facts, objects, and each table should have a set model of relatively self-contained facts. The result of this is that your table should look something like this:

  person {person_id pk, name, dob, ...} student {person_id pkfk (person.person_id), admission_id,. .. An employee can also be an employee who may be a model, real life will be closer to a heritage graph. 


Comments