正在加载图片...
Appendix E Hierarchical Model Hayes Main Harrison Johnson Alma Palo Alto Smith North Rye A-102400 A-101 500 A-201900 A-201 900 A-215 700 (a) A-102400 A-101 500 A-201900 A-215700 Hayes Main Harrison Johnson Alma Palo Alto Johnson Alma Palo Alto Smith North Rye Smith North Rye (b) Figure E.7 Sample database corresponding to diagram of Figure E.6b. A sample database corresponding to the tree-structure diagram of Figure E.6b appears in Figure E.7.There are two database trees.The first tree(Figure E.7a) corresponds to the tree-structure diagram Ti;the second tree(Figure E.7b)corre- sponds to the tree-structure diagram T2.As we can see,all customer and account records are replicated in both database trees.In addition,account record A-201 ap- pears twice in the first tree,whereas customer records Johnson and Smith appear twice in the second tree. If a relationship also includes a descriptive attribute,the transformation from an E-R diagram to a tree-structure diagram is more complicated.A link cannot contain any data value.In this case,a new record type needs to be created,and the appropriate links need to be established.The manner in which links are formed depends on the way the relationship depositor is defined. Consider the E-R diagram of Figure E.3a.Suppose that we add the attribute access date to the relationship depositor,to denote the most recent date on which a customer accessed the account.This newly derived E-R diagram appears in Figure E.8a.To transform this diagram into a tree-structure diagram,we must 1.Create a new record type access date with a single field. 2.Create the following two links:6 Appendix E Hierarchical Model Figure E.7 Sample database corresponding to diagram of Figure E.6b. A sample database corresponding to the tree-structure diagram of Figure E.6b appears in Figure E.7. There are two database trees. The first tree (Figure E.7a) corresponds to the tree-structure diagram T1; the second tree (Figure E.7b) corre￾sponds to the tree-structure diagram T2. As we can see, all customer and account records are replicated in both database trees. In addition, account record A-201 ap￾pears twice in the first tree, whereas customer records Johnson and Smith appear twice in the second tree. If a relationship also includes a descriptive attribute, the transformation from an E-R diagram to a tree-structure diagram is more complicated. A link cannot contain any data value. In this case, a new record type needs to be created, and the appropriate links need to be established. The manner in which links are formed depends on the way the relationship depositor is defined. Consider the E-R diagram of Figure E.3a. Suppose that we add the attribute access date to the relationship depositor, to denote the most recent date on which a customer accessed the account. This newly derived E-R diagram appears in Figure E.8a. To transform this diagram into a tree-structure diagram, we must 1. Create a new record type access date with a single field. 2. Create the following two links:
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有