问题描述
当创建
I think the first (single table) is best because, even if I risk having a few Nulls, an ISIN is an ISIN and is well defined attribute of the Fund.
推荐答案
我会做单表因为Identifiers表方法对idValue的数据类型做出假设。如果你得到一些使用guid而不是int的新东西怎么办?
I would do single table because the Identifiers table method makes assumptions about the datatype of the idValue. What if you get something new that uses a guid rather than an int?
您仍然可以为每个可能的资产ID执行单独的列,并将关于资产的数据保存在一个单独的表中,从而替代代理ID。您采取的方法主要取决于您将如何使用数据,以及添加新资产ID类型的频率。
You could still do a separate column for each possible asset ID and keep the data about the assets in a separate table that keys off the surrogate ID. The approach you take will depend mainly on how you will use the data, and how often you might add new asset ID types.
这篇关于数据库设计:多个潜在标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!