Why use a 1-to-1 relationship in database design?

后端 未结 6 1441
小蘑菇
小蘑菇 2020-11-28 09:21

I am having a hard time trying to figure out when to use a 1-to-1 relationship in db design or if it is ever necessary.

If you can select only the columns you need i

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-28 10:00

    Just a few samples from past projects:

    • a TestRequests table can have only one matching Report. But depending on the nature of the Request, the fields in the Report may be totally different.
    • in a banking project, an Entities table hold various kind of entities: Funds, RealEstateProperties, Companies. Most of those Entities have similar properties, but Funds require about 120 extra fields, while they represent only 5% of the records.

提交回复
热议问题