gpt4 book ai didi

database - Data Vault - 如何选择业务 key ?

转载 作者:搜寻专家 更新时间:2023-10-30 22:35:36 25 4
gpt4 key购买 nike

如果以下三个唯一属性来自 3NF 模型中的 SalesOrderHeader 表,那么哪一个将是 SalesOrderHeader Hub 的理想业务键:

  1. SalesOrderID(原表PK)
  2. 销售订单号
  3. 采购订单号

最佳答案

定义

根据 Data Vault 2.0 方法,业务 key 是业务用来标识一条记录的 key (来自 here ):

Business keys are supposed to have meaning to the business user. In a perfect world, they really should be decipherable by individuals who live and work in that industry. For instance, VIN (vehicle identification number) numbers are really well known to those who work in the auto industry. Some individuals are so adept at reading these numbers they can tell you what some of the sequences mean – define the number for you. [..]

This key doesn’t change when it goes from the Sales system to the Contracts system, it doesn’t change when it’s transferred from the contracts system to the manufacturing system, or any other system in the business. It stays consistent once assigned. [..]

案例

注意:我在回答中假设了很多,因为我不了解业务及其依赖关系。

SalesOrderID 是一个内部 ID,除了技术用户外,任何人都看不到。

并且 PurchaseOrderNumber 可能连接到 Purchase,这在语义上可能完全不同。尽管根据用例的不同,这个键甚至代理键可能是有意义的。

因此,为了识别 SalesOrderHeader,我会使用 SalesOrderNumber,因为这个数字似乎直接与 header 相关联。

关于database - Data Vault - 如何选择业务 key ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37847844/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com