8.3 NESMA 1:(N) 依赖关系案例研究

8.3 1:(N) with dependent existence (1对多依赖关系)

原文

Problem description

The normalized data model of an invoicing system indicates that a 1:(N) relationship exists between Invoice Header and Invoice Line. The application allows users to create an Invoice Header first to which lines can be added later on; hence, the optionality. If users decide at a given moment to delete the Invoice Header, the Invoice Lines are also automatically deleted.

在这里插入图片描述

How many logical files should be distinguished here?

Discussion

Invoice Header and Invoice Line have a 1:(N) relationship. According to the table in section 4.21.5, the number of logical files is determined based on entity dependence. Because of the business rule that any Invoice Lines linked to the Invoice Header are deleted automatically when the Invoice Header is deleted, we can conclude that Invoice Line is entity dependent with respect to Invoice Header. (See situation 1 in the discussion about (in)dependence in a 1:(N) relationship in section 4.21.5) There is, then, one logical unit called Invoice that contains the entity types Invoice Header and Invoice Line.

Solution

Count one logical file with two record types.

翻译

问题描述

发票系统的规范化数据模型表明,发票标题和发票行之间存在1:(N)关系。该应用程序允许用户首先创建一个发票标题,稍后可以添加行;因此,发票行是可选择性的。如果用户在删除发票标题,发票行也会自动删除。

在这里插入图片描述

这里应该区分多少个逻辑文件?

讨论

发票标题和发票行具有1:(N)关系。根据第4.21.5节中的表格,逻辑文件的数量根据实体依赖性确定。由于删除发票标题时,链接到发票标题的任何发票行都会自动删除的业务规则,我们可以得出结论,发票行与发票标题相关。(参见第4.21.5节中关于1:(N)关系中的(in)依赖关系的讨论中的情况1)然后,有一个称为发票的逻辑单元,包含实体类型发票标题和发票行。

结论

识别1个逻辑文件2个记录类型

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值