8.1 NESMA 1:(N) 关系案例分析

8 DENORMALIZATION (非规范化)

In this illustration, three examples of denormalization are given for a situation in which
a 1:(N) relationship exists between two entity types. The situations 1:N, (1):N, (1):(N), 1:(1),
and (1):(1) speak for themselves. (See section 4.21.3 for information about the notation
method.)

8.1 1:(N) with independent existence(1:(N)独立关系)

Problem description

The normalized data model of a library application shows that there is a 1:(N) relationship between the entity types Book and Loan. A book does not have to be loaned out and, so, optionality is a factor in the relationship. If a loan is made, it always relates to one Book(no optionality).

The library’s business rule is that a Book can be deleted only if a Loan is no longer linked to it.

在这里插入图片描述

Does this case involve one or two logical files?

Discussion

Book and Loan have a 1:(N) relationship. According to the table in section 4.21.5, the number of logical files is determined on the basis of entity dependence. Because the library may delete a Book only when a Loan is no longer linked to it, we can conclude that Loan also has a separate significance to the application apart from Book and, therefore, is entity independent with respect to Book. (See situation 2 in the discussion about (in)dependence in a 1:(N) relationship in section 4.21.4.) There are, then, two logical files.

Solution

Count two internal logical files.

翻译

在本示例中,给出了两种实体类型之间存在1:(N)关系的情况下的三个非规范化示例。情境1:N,(1:N),(1):(N),1:(1)和(1):(1)。(有关表示法的信息,请参见第4.21.3节。)

问描述

图书馆应用程序的规范化数据模型表明,实体类型“图书”和“借阅”之间存在1:(N)关系。一本书可以不借阅,针对一本书是否借阅存在选择性。如果借阅,借阅记录总是与一本书相关(无选择权)。

图书馆的业务规则是,只有当借阅不再与图书链接时,才能删除图书。

在这里插入图片描述

在这个案例中涉及1个还是两个逻辑文件?

讨论

图书和借阅之间存在1:(N)关系。根据第4.21.5节中的表格,逻辑文件的数量是根据实体相关性确定的。由于图书馆只有在图书不再与借阅链接时才可以删除图书,因此我们可以得出结论,除了图书之外,借阅对应用程序也有单独的意义,因此,借阅是独立于实体的。(参见第4.21.4节中关于1:(N)关系中的(in)依赖性的讨论中的情况2。)因此,有两个逻辑文件。

结论

识别两个内部逻辑文件

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值