Designing a conditional database relationship in SQL Server

前端 未结 7 1123
日久生厌
日久生厌 2020-12-15 11:29

I have three basic types of entities: People, Businesses, and Assets. Each Asset can be owned by one and only one Person or Business. Each Person and Business can own from

相关标签:
7条回答
  • 2020-12-15 12:32

    You can have another entity from which Person and Business "extend". We call this entity Party in our current project. Both Person and Business have a FK to Party (is-a relationship). And Asset may have also a FK to Party (belongs to relationship).

    With that said, if in the future an Asset can be shared by multiple instances, is better to create m:n relationships, it gives flexibility but complicates the application logic and the queries a bit more.

    0 讨论(0)
提交回复
热议问题