Database : what design to point on two possibilities?

后端 未结 3 581
执念已碎
执念已碎 2021-01-24 09:25

I am designing a datamodel for a new project.

One of the requirements specifies that some objects can point either a person or a company.

What is the sma

3条回答
  •  耶瑟儿~
    2021-01-24 09:59

    I suggest you make company and person subtypes that reference the same supertype (actor). Note that you don't need separate person_id, company_id because an actor must be one or other and cannot be both. Like this:

    enter image description here

提交回复
热议问题