10 Appendix E Hierarchical Model Rather than present a general transformation algorithm,we present a single ex- ample to illustrate the overall strategy that you can apply to deal with such a transformation. Consider the E-R diagram of Figure E.12a,which consists of the three entity sets customer,account,and branch,related through the general relationship set CAB with no descriptive attribute. There are many different ways to transform this E-R diagram into a tree- structure diagram.Again,all share the property that the underlying database tree (or trees)will have replicated records.The most straightforward transformation is to create two tree-structure diagrams,as shown in Figure E.12b. An instance of the database corresponding to this schema is illustrated in Fig- ure E.13.It shows that Hayes has account A-102 in the Perryridge branch;Johnson has accounts A-101 and A-201 in the Downtown and Perryridge branches,respec- tively;and Smith has accounts A-201 and A-215 in the Perryridge and Mianus branches,respectively. We can extend the preceding transformation algorithm in a straightforward manner to deal with relationships that span more than three entity sets.We simply replicate the various record types,and generate as many tree-structure Downtown Brooklyn 9000000 Perryridge Horseneck 17000000 Mianus Horseneck 400000 Haves Main Harrison Smith North Rye Johnson Alma Palo Alto A-102 400 Johnson Alma Palo Alto Smith North Rye A-101500 A-201900 A-201900 A-215700 (a) Downtown Brooklyn 9000000 Perryridge Horseneck 17000000 Mianus Horseneck 400000 A-102400 A-101 500 A-201900 A215700 Hayes Main Harrison Johnson Alma Palo Alto Johnson Alma Palo Alto Smith North Rye (b) Smith North Rye Figure E.13 Sample database corresponding to diagram of Figure E.12b.10 Appendix E Hierarchical Model Rather than present a general transformation algorithm, we present a single example to illustrate the overall strategy that you can apply to deal with such a transformation. Consider the E-R diagram of Figure E.12a, which consists of the three entity sets customer, account, and branch, related through the general relationship set CAB with no descriptive attribute. There are many different ways to transform this E-R diagram into a treestructure diagram. Again, all share the property that the underlying database tree (or trees) will have replicated records. The most straightforward transformation is to create two tree-structure diagrams, as shown in Figure E.12b. An instance of the database corresponding to this schema is illustrated in Figure E.13. It shows that Hayes has account A-102 in the Perryridge branch; Johnson has accounts A-101 and A-201 in the Downtown and Perryridge branches, respectively; and Smith has accounts A-201 and A-215 in the Perryridge and Mianus branches, respectively. We can extend the preceding transformation algorithm in a straightforward manner to deal with relationships that span more than three entity sets. We simply replicate the various record types, and generate as many tree-structure Figure E.13 Sample database corresponding to diagram of Figure E.12b