Single Relationships customer-streef account-number balance customer-name customer-city customer depositor account (a)E-R diagram customer-name customer-street customer-city customer account-number balance account (b)Tree-structure diagram Database System Concepts,5th Ed. B.6 @Silberschatz,Korth and Sudarshan
Database System Concepts, 5 B.6 ©Silberschatz, Korth and Sudarshan th Ed. Single Relationships
Single relationships (Cont.) Example E-R diagram with two entity sets,customer and account related through a binary,one-to-many relationship depositor. Corresponding tree-structure diagram has the record type customer with three fields:customer-name, customer-street,and customer-city. the record type account with two fields:account-number and balance the link depositor,with an arrow pointing to customer Database System Concepts,5th Ed. B.7 ©Silberschat乜,Korth and Sudarshan
Database System Concepts, 5 B.7 ©Silberschatz, Korth and Sudarshan th Ed. Single relationships (Cont.) Example E-R diagram with two entity sets, customer and account, related through a binary, one-to-many relationship depositor. Corresponding tree-structure diagram has the record type customer with three fields: customer-name, customer-street, and customer-city. the record type account with two fields: account-number and balance the link depositor, with an arrow pointing to customer
Single Relationships (Cont.) If the relationship depositor is one to one,then the link depositor has two arrows. customer-name customer-street customer-city customer account-number balance account Only one-to-many and one-to-one relationships can be directly represented in the hierarchical mode. Database System Concepts,5th Ed. B.8 ©Silberschat乜,Korth and Sudarshan
Database System Concepts, 5 B.8 ©Silberschatz, Korth and Sudarshan th Ed. Single Relationships (Cont.) If the relationship depositor is one to one, then the link depositor has two arrows. Only one-to-many and one-to-one relationships can be directly represented in the hierarchical mode
Transforming Many-To-Many Relationships Must consider the type of queries expected and the degree to which the database schema fits the given E-R diagram. In all versions of this transformation,the underlying database tree (or trees)will have replicated records. Database System Concepts,5th Ed. B.9 ©Silberschat乜,Korth and Sudarshan
Database System Concepts, 5 B.9 ©Silberschatz, Korth and Sudarshan th Ed. Transforming Many-To-Many Relationships Must consider the type of queries expected and the degree to which the database schema fits the given E-R diagram. In all versions of this transformation, the underlying database tree (or trees) will have replicated records
Many-To Many Relationships (Cont.) customer-street account-number balance customer-nane customer-city customer depositor account (a)E-R diagram customer-name customer-street customer-city account-number balance customer account account-number balance customer-name customer-street customer-city account customer tree T1 treeT2 (b)Tree-structure diagrams Database System Concepts,5th Ed. B.10 @Silberschatz,Korth and Sudarshan
Database System Concepts, 5 B.10 ©Silberschatz, Korth and Sudarshan th Ed. Many-To Many Relationships (Cont.)