Repeating Groups (Cont.) customer-name customer has customer-address customer-name ↑c1 stomer customer-street customer-city customer-street customer-city customer-address (a)E-R diagram (b)Data-structure diagram With the repeating-group construct,the data-structure diagram consists of the single record type customer. Database System Concepts,5th Ed. A.11 ©Silberschat乜,Korth and Sudarshan
Database System Concepts, 5 A.11 ©Silberschatz, Korth and Sudarshan th Ed. Repeating Groups (Cont.) With the repeating-group construct, the data-structure diagram consists of the single record type customer
DBTG Data-Retrieval Facility The DBTG data manipulation language consists of a number of commands that are embedded in a host language. Run unit-system application program consisting of a sequence of host language and DBTG command statements.Statements access and manipulate database items as well as locally declared variables. Program work-area (or user work area)-a buffer storage area the system maintains for each application program Database System Concepts,5th Ed. A.12 ©Silberschat乜,Korth and Sudarshan
Database System Concepts, 5 A.12 ©Silberschatz, Korth and Sudarshan th Ed. DBTG Data-Retrieval Facility The DBTG data manipulation language consists of a number of commands that are embedded in a host language. Run unit — system application program consisting of a sequence of host language and DBTG command statements. Statements access and manipulate database items as well as locally declared variables. Program work-area (or user work area) — a buffer storage area the system maintains for each application program
DBTG Variables Record Templates Currency pointers Current of record type Current of set type Current of run unit Status flags DB-status is most frequently used Additional variables:DB-set-name,DB-record-name,and DB-data-name Database System Concepts,5th Ed. A.13 @Silberschatz,Korth and Sudarshan
Database System Concepts, 5 A.13 ©Silberschatz, Korth and Sudarshan th Ed. DBTG Variables Record Templates Currency pointers Current of record type Current of set type Current of run unit Status flags DB-status is most frequently used Additional variables: DB-set-name, DB-record-name, and DB-data-name
Example Schema customer-name customer-street customer-city branch-name branch-city assets customer branch depositor account-branch account-number balance account Hayes Main Harrison A-102 400 Perryridge Horseneck 1700000 A-101500 Johnson Alma Palo Alto Downtown Brooklyn 9000000 A-201 900 A-305 350 Round Hill Horseneck 8000000 Turner Putnam Stamford A-4021000 A-4081123 Database System Concepts,5th Ed. A.14 @Silberschatz,Korth and Sudarshan
Database System Concepts, 5 A.14 ©Silberschatz, Korth and Sudarshan th Ed. Example Schema
Example Program Work Area Templates for three record types:customer,account,and branch. Six currency pointers Three pointers for record types:one each tot he most recently accessed customer,account,and branch record Two pointers for set types:one to the most recently accessed record in an occurrence of the set depositor,one to the most recently accessed record in an occurrence of the set account- branch One run-unit pointer. Status flags:four variables defined previously Following diagram shows an example program work area state. Database System Concepts,5th Ed. A.15 ©Silberschat乜,Korth and Sudarshan
Database System Concepts, 5 A.15 ©Silberschatz, Korth and Sudarshan th Ed. Example Program Work Area Templates for three record types: customer, account, and branch. Six currency pointers Three pointers for record types: one each tot he most recently accessed customer, account, and branch record Two pointers for set types: one to the most recently accessed record in an occurrence of the set depositor, one to the most recently accessed record in an occurrence of the set accountbranch One run-unit pointer. Status flags: four variables defined previously Following diagram shows an example program work area state