Many-To-Many Relationships (Cont.) Create two tree-structure diagrams,71,with the root customer,and 72, with the root account. In T1,create depositor,a many-to-one link from account to customer. In T2,create account-customer,a many-to-one link from customer to account. Database System Concepts,5th Ed. B.11 ©Silberschat乜,Korth and Sudarshan
Database System Concepts, 5 B.11 ©Silberschatz, Korth and Sudarshan th Ed. Many-To-Many Relationships (Cont.) Create two tree-structure diagrams, T1 , with the root customer, and T2 , with the root account. In T1 , create depositor, a many-to-one link from account to customer. In T2 , create account-customer, a many-to-one link from customer to account
Sample Database Hayes Main Harrison Tohnson Alma Palo Alto Smith North Rye A-102 400 A-101 500 A-201 900 A-201 900 A-215 700 (a) A-102 400 A-101 500 A-201 900 A-215 700 Hayes Main Harrison Johnson Alma Palo Alto Johnson Alma Palo Alto Smith North Rye Smith North Rye (b) Database System Concepts,5th Ed. B.12 @Silberschatz,Korth and Sudarshan
Database System Concepts, 5 B.12 ©Silberschatz, Korth and Sudarshan th Ed. Sample Database
General Relationships Example ternary E-R diagram and corresponding tree-structure diagrams are shown on the following page. access-date customer-street account-number balance customer-name customer-city customer depositor account (a)E-R diagram customer-name custonter-street customer-city customer access-date access-date account-number balance account (b)Tree-structure diagram Database System Concepts,5th Ed. B.13 @Silberschatz,Korth and Sudarshan
Database System Concepts, 5 B.13 ©Silberschatz, Korth and Sudarshan th Ed. General Relationships Example ternary E-R diagram and corresponding tree-structure diagrams are shown on the following page
Sample Ternary Databases.(a)T(b)T2 Hayes Main Harrison lohnson Alma Palo Alto Smith North Rye 10June1996 24May1996 17June1996 21June1996 3 June 1996 A-102 400 A-101 500 A-201 900 A-201 900 A-215 700 (a) A-102 400 A-101 500 A-201 900 A-215 700 10June1996 24May1996 17June1996 21June1996 3 June 1996 Hayes Main Harrison Johnson Alma Palo Alto lohnson Alma Palo Alto Smith North Rye Smith North Rye (b) Database System Concepts,5th Ed. B.14 @Silberschatz,Korth and Sudarshan
Database System Concepts, 5 B.14 ©Silberschatz, Korth and Sudarshan th Ed. Sample Ternary Databases. (a) T1 (b) T2
Several Relationships To correctly transform an E-R diagram with several relationships,split the unrooted tree structure diagrams into several diagrams,each of which is a rooted tree. Example E-R diagram and transformation leading to diagram that is not a rooted tree: Database System Concepts,5th Ed. B.15 ©Silberschat乜,Korth and Sudarshan
Database System Concepts, 5 B.15 ©Silberschatz, Korth and Sudarshan th Ed. Several Relationships To correctly transform an E-R diagram with several relationships, split the unrooted tree structure diagrams into several diagrams, each of which is a rooted tree. Example E-R diagram and transformation leading to diagram that is not a rooted tree: