General Relationships To represent an E-R relationship of degree 3 or higher,connect the participating record types through a new record type that is linked directly to each of the original record types. 1.Replace entity sets account,customer,and branch with record types account,customer,and branch,respectively. 2. Create a new record type Rlink(referred to as a dummy record type) 3.Create the following many-to-one links: CustRlink from Rlink record type to customer record type AcctRInk from Rlink record type to account record type BrncRInk from Rlink record type to branch record type Database System Concepts,5th Ed. A.6 @Silberschatz,Korth and Sudarshan
Database System Concepts, 5 A.6 ©Silberschatz, Korth and Sudarshan th Ed. General Relationships To represent an E-R relationship of degree 3 or higher, connect the participating record types through a new record type that is linked directly to each of the original record types. 1. Replace entity sets account, customer, and branch with record types account, customer, and branch, respectively. 2. Create a new record type Rlink (referred to as a dummy record type). 3. Create the following many-to-one links: CustRlink from Rlink record type to customer record type AcctRlnk from Rlink record type to account record type BrncRlnk from Rlink record type to branch record type
Network Representation of Ternary Relationship branch-city branch-name assets branch customer-street account-number balance customer-name customer-city customer CAB account (a)E-R diagram customer-name customer-street customer-city branch-name branch-city assets customer branch account-number balance AcctRInk account CustRInk BrnchRInk Rlink (b)Data structure diagram Database System Concepts,5th Ed. A.7 ©Silberschat乜,Korth and Sudarshan
Database System Concepts, 5 A.7 ©Silberschatz, Korth and Sudarshan th Ed. Network Representation of Ternary Relationship
The DBTG CODASYL Model All links are treated as many-to-one relationships. To model many-to-many relationships,a record type is defined to represent the relationship and two links are used. customer-streef account-number balance customer-name customer-city customer depositor account (a)E-R diagram customer-name customer-street customer-city account-number balance customer account CustRInk AcctRInk Rlink (b)Data structure diagram Database System Concepts,5th Ed. A.8 ©Silberschat乜,Korth and Sudarshan
Database System Concepts, 5 A.8 ©Silberschatz, Korth and Sudarshan th Ed. The DBTG CODASYL Model All links are treated as many-to-one relationships. To model many-to-many relationships, a record type is defined to represent the relationship and two links are used
DBTG Sets The structure consisting of two record types that are linked together is referred to in the DBTG model as a DBTG set In each DBTG set,one record type is designated as the owner,and the other is designated as the member,of the set. Each DBTG set can have any number of set occurrences(actual instances of linked records). Since many-to-many links are disallowed,each set occurrence has precisely one owner,and has zero or more member records. No member record of a set can participate in more than one occurrence of the set at any point. A member record can participate simultaneously in several set occurrences of different DBTG sets Database System Concepts,5th Ed. A.9 ©Silberschat乜,Korth and Sudarshan
Database System Concepts, 5 A.9 ©Silberschatz, Korth and Sudarshan th Ed. DBTG Sets The structure consisting of two record types that are linked together is referred to in the DBTG model as a DBTG set In each DBTG set, one record type is designated as the owner, and the other is designated as the member, of the set. Each DBTG set can have any number of set occurrences (actual instances of linked records). Since many-to-many links are disallowed, each set occurrence has precisely one owner, and has zero or more member records. No member record of a set can participate in more than one occurrence of the set at any point. A member record can participate simultaneously in several set occurrences of different DBTG sets
Repeating Groups Provide a mechanism for a field to have a set of values rather than a single value. Alternative representation of weak entities from the E-R model Example:Two sets. customer(customer-name) customer-address(customer-street,customer-city) The following diagrams represent these sets without the repeating- group construct. Database System Concepts,5th Ed. A.10 ©Silberschat乜,Korth and Sudarshan
Database System Concepts, 5 A.10 ©Silberschatz, Korth and Sudarshan th Ed. Repeating Groups Provide a mechanism for a field to have a set of values rather than a single value. Alternative representation of weak entities from the E-R model Example: Two sets. customer (customer-name) customer-address (customer-street, customer-city) The following diagrams represent these sets without the repeatinggroup construct