正在加载图片...
Appendix E Hierarchical Model customer name customer street customer_city customer account number balance account Figure E.4 Tree-structure diagram with one-to-one relationship. the entity set customer.It includes three fields:customer-name,customer street,and customer city.Similarly,account is the record type corresponding to the entity set account.It includes two fields:account number and balance.Finally,the relationship depositor has been replaced with the link depositor,with an arrow pointing to customer record type. An instance of a database corresponding to the described schema may thus contain a number of customer records linked to a number of account records,as in Figure E.1.Since the relationship is one to many from customer to account, a customer can have more than one account,as does Johnson,who has both accounts A-101 and A-201.An account,however,cannot belong to more than one customer;none do in the sample database. If the relationship depositor is one to one,then the link depositor has two arrows:one pointing to account record type,and one pointing to customer record type(Figure E.4).A sample database corresponding to this schema appears in Figure E.5.Since the relationship is one to one,an account can be owned by precisely one customer,and a customer can have only one account,as is indeed the case in the sample database. If the relationship depositor is many to many(see Figure E.6a),then the trans- formation from an E-R diagram to a tree-structure diagram is more complicated. Only one-to-many and one-to-one relationships can be directly represented in the hierarchical model. There are many different ways to transform this E-R diagram to a tree-structure diagram.All these diagrams,however,share the property that the underlying database tree (or trees)will have replicated records. Hayes Main Harrison Lindsay Park Pittsfield Turner Putnam Stamford A-102 400 A-222 700 A-201 900 A-305 350 Figure E.5 Sample database corresponding to diagram of Figure E.4.4 Appendix E Hierarchical Model Figure E.4 Tree-structure diagram with one-to-one relationship. the entity set customer. It includes three fields: customer name, customer street, and customer city. Similarly, account is the record type corresponding to the entity set account. It includes two fields: account number and balance. Finally, the relationship depositor has been replaced with the link depositor, with an arrow pointing to customer record type. An instance of a database corresponding to the described schema may thus contain a number of customer records linked to a number of account records, as in Figure E.1. Since the relationship is one to many from customer to account, a customer can have more than one account, as does Johnson, who has both accounts A-101 and A-201. An account, however, cannot belong to more than one customer; none do in the sample database. If the relationship depositor is one to one, then the link depositor has two arrows: one pointing to account record type, and one pointing to customer record type (Figure E.4). A sample database corresponding to this schema appears in Figure E.5. Since the relationship is one to one, an account can be owned by precisely one customer, and a customer can have only one account, as is indeed the case in the sample database. If the relationship depositor is many to many (see Figure E.6a), then the trans￾formation from an E-R diagram to a tree-structure diagram is more complicated. Only one-to-many and one-to-one relationships can be directly represented in the hierarchical model. There are many different ways to transform this E-R diagram to a tree-structure diagram. All these diagrams, however, share the property that the underlying database tree (or trees) will have replicated records. Figure E.5 Sample database corresponding to diagram of Figure E.4
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有