Chapter A:Network Model Basic Concepts Data-Structure Diagrams The DBTG CODASYL Model DBTG Data-Retrieval Facility DBTG Update Facility DBTG Set-Processing Facility Mapping of Networks to Files Database System Concepts,5th Ed. A.1 @Silberschatz,Korth and Sudarshan
Database System Concepts, 5 A.1 ©Silberschatz, Korth and Sudarshan th Ed. Chapter A: Network Model Basic Concepts Data-Structure Diagrams The DBTG CODASYL Model DBTG Data-Retrieval Facility DBTG Update Facility DBTG Set-Processing Facility Mapping of Networks to Files
Basic Concepts Data are represented by collections of records. similar to an entity in the E-R model Records and their fields are represented as record type type customer record type account record customer-name:string; account-number:integer; customer-street:string; balance:integer; customer-city:string; end end Relationships among data are represented by links similar to a restricted(binary)form of an E-R relationship restrictions on links depend on whether the relationship is many- many,many-to-one,or one-to-one. Database System Concepts,5th Ed. A.2 ©Silberschat乜,Korth and Sudarshan
Database System Concepts, 5 A.2 ©Silberschatz, Korth and Sudarshan th Ed. Basic Concepts Data are represented by collections of records. similar to an entity in the E-R model Records and their fields are represented as record type type customer = record type account = record customer-name: string; account-number: integer; customer-street: string; balance: integer; customer-city: string; end end Relationships among data are represented by links similar to a restricted (binary) form of an E-R relationship restrictions on links depend on whether the relationship is manymany, many-to-one, or one-to-one
Data-Structure Diagrams Schema representing the design of a network database. A data-structure diagram consists of two basic components: Boxes,which correspond to record types. Lines,which correspond to links. Specifies the overall logical structure of the database. Database System Concepts,5th Ed. A.3 ©Silberschat乜,Korth and Sudarshan
Database System Concepts, 5 A.3 ©Silberschatz, Korth and Sudarshan th Ed. Data-Structure Diagrams Schema representing the design of a network database. A data-structure diagram consists of two basic components: Boxes, which correspond to record types. Lines, which correspond to links. Specifies the overall logical structure of the database
Data-Structure Diagrams(Cont.) For every E-R diagram,there is a corresponding data-structure diagram. customer-street account-number balance customer-name customer-city customer depositor account (a)E-R diagram customer-name customer-street customer-city account-number balance depositor customer account (b)Data structure diagram Database System Concepts,5th Ed. A.4 ©Silberschat乜,Korth and Sudarshan
Database System Concepts, 5 A.4 ©Silberschatz, Korth and Sudarshan th Ed. Data-Structure Diagrams (Cont.) For every E-R diagram, there is a corresponding data-structure diagram
Data-Structure Diagrams(Cont.) Since a link cannot contain any data value,represent an E-R relationship with attributes with a new record type and links. access-date customer-street Caccount-number balance customer-name customer-city customer depositor account (a)E-R diagram customer-name customer-street customer-city account-number balance customer account customer-date account-date access-date access-date (b)Network diagram Database System Concepts,5th Ed. A.5 @Silberschatz,Korth and Sudarshan
Database System Concepts, 5 A.5 ©Silberschatz, Korth and Sudarshan th Ed. Data-Structure Diagrams (Cont.) Since a link cannot contain any data value, represent an E-R relationship with attributes with a new record type and links
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