THE HIERARCHICAL DATA MODEL SECTION 9 Fundamentals.

Slides:



Advertisements
Similar presentations
Unit 5 The Network Model  5.1 The Network Model  5.2 IDMS.
Advertisements

The Hierarchical Model
Chapter 12 File Processing and Data Management Concepts
Database Systems: Design, Implementation, and Management Tenth Edition
Muhamad AbduhInstitut Teknologi Bandung5.1 W e e k 5 5 DATABASE.
Introduction to Databases
Chapter 16 The Hierarchical and Network Data Models David M. Kroenke Database Processing © 2000 Prentice Hall.
Introduction to Database Management  Department of Computer Science Northern Illinois University January 2001.
©Silberschatz, Korth and SudarshanB.1Database System Concepts Chapter B: Hierarchical Model Basic Concepts Tree-Structure Diagrams Data-Retrieval Facility.
1 Basic DB Terms Data: Meaningful facts, text, graphics, images, sound, video segments –A collection of individual responses from a marketing research.
File Systems and Databases
File Systems and Databases Hachim Haddouti
LECTURE 2 DATABASE SYSTEM CONCEPTS AND ARCHITECTURE.
1 DATABASE TECHNOLOGIES BUS Abdou Illia, Fall 2007 (Week 3, Tuesday 9/4/2007)
Hierarchical Model.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
Week 1 Lecture MSCD 600 Database Architecture Samuel ConnSamuel Conn, Asst. Professor Suggestions for using the Lecture Slides.
CS370 Spring 2007 CS 370 Database Systems Lecture 2 Overview of Database Systems.
THE NETWORK DATA MODEL SECTION 8 An early DBMS. Background Networks are a natural way of representing relationships among objects The network data model.
Chapter 2 CIS Sungchul Hong
Introduction to Accounting Information Systems
Database Management Systems Accounting Information Systems, 5 th edition James A. Hall COPYRIGHT © 2007 Thomson South-Western, a part of The Thomson Corporation.
Database Systems: Design, Implementation, and Management Ninth Edition
Chapter 9 Designing Databases Modern Systems Analysis and Design Sixth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Concepts and Terminology Introduction to Database.
Chapter # 2 Data Models BIS Database Systems A.Thanop Somprasong
Chapter 2 Database Environment. Agenda Three-Level ANSI-SPARC Architecture Database Languages Data Models Functions of DBMS Components of DBMS Data Dictionary.
1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.
Unit 4 The Hierarchy Model
Information Management System DB Concepts & Programming.
 2001 Prentice Hall Business Publishing, Accounting Information Systems, 8/E, Bodnar/Hopwood A field may be a single character or number, or it.
6/2/20161 Database Systems Lecture # 3 By: Asma Ahmad Jan 21 st, 2011.
Chapter 9 Database Systems Introduction to CS 1 st Semester, 2014 Sanghyun Park.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Hierarchical Model By Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany) DIRECTOR ARUNAI ENGINEERING COLLEGE TIRUVANNAMALAI.
B.1 Chapter B: Hierarchical Model Basic Concepts Tree-Structure Diagrams Data-Retrieval Facility Update Facility Virtual Records Mapping of Hierarchies.
Data Structure Concepts Record Collection of field values Grouped as record types Parent-Child Relationships 1 :N Occurrence : ONE parent and zero or.
History of Implementation Data Models. Databases were: Early Business Computer Systems –Accounting functions - payroll, profit/loss statements Files of.
Chapter 10 Designing Databases. Objectives:  Define key database design terms.  Explain the role of database design in the IS development process. 
Data Structures: A Pseudocode Approach with C, Second Edition 1 Chapter 7 Objectives Create and implement binary search trees Understand the operation.
1 Geog 357: Data models and DBMS. Geographic Decision Making.
Introduction to Databases Angela Clark University of South Alabama.
BINARY TREES Objectives Define trees as data structures Define the terms associated with trees Discuss tree traversal algorithms Discuss a binary.
1 Information System Analysis Topic-3. 2 Entity Relationship Diagram \ Definition An entity-relationship (ER) diagram is a specialized graphic that illustrates.
Before the Relational Model COMP3211 Advanced Databases Dr Nicholas Gibbins –
Data Models. 2 The Importance of Data Models Data models –Relatively simple representations, usually graphical, of complex real-world data structures.
DBS201: Data Modeling. Agenda Data Modeling Types of Models Entity Relationship Model.
1 Database Design Chapter-2- Database System Concepts and Architecture Reference: Prof. Mona Mursi Lecture notes.
1 © 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the.
Databases and DBMSs Todd S. Bacastow January
Architecture & Data Models
Appendix E: Hierarchical Model
Chapter 9 Database Systems
Appendix E: Hierarchical Model
Appendix D: Network Model
Section 8.1 Trees.
Chapter 9 Designing Databases
Introduction to Database Management System
File Systems and Databases
Physical Database Design
Databases and Structured Files: What is a database?
Data Model.
ITEC 3220A Using and Designing Database Systems
Appendix D: Network Model
UNIT-I Introduction to Database Management Systems
Legacy Databases.
Presentation transcript:

THE HIERARCHICAL DATA MODEL SECTION 9 Fundamentals

Introduction Relational model –Grounded in mathematics Network model –Evolved from effort to establish standards Hierarchical –Evolved?

Some Hierarchical Systems Most widely used Other Hierarchical Systems IMS

Developed in early 1960s The reason? Still remains an actively used DB

Basic Concepts Special case of the network model Parent Child

Tree Hierarchical data model Segment types Parent-child relationship type

A conceptual model RETIREMENT PLAN EMPLOYEE HAS- EMPLOYEE PROVIDED- FOR 1 MM 1 DEPARTMENT

A network data model DEPARTMENT RETIREMENT PLAN EMPLOYEE DEPARTMENT/ EMPLOYEE SET RETIREMNT PLAN/ EMPLOYEE SET

A hierarchical data model DEPARTMENT RETIREMENT PLAN EMPLOYEE DEPARTMENT/ EMPLOYEE PCR RETIREMNT PLAN/ EMPLOYEE PCR EMPLOYEE

Tree Structure Conventions 2.Every segment a child 3.A parent can have many children 4.A child can only have one parent 1.Root segment

6.Ancestors and dependent segments 7.Root of a sub-tree 5.A leaf segment

Hierarchical arrangement of segment types DEPTNAMEMANAGER EMPNAMEYRS-SVC PROJNAMEDIVISIONSKILLCODESKILLNAME DEPARTMENT EMPLOYEE SKILLASSIGNEDTO Segment type

Hierarchical occurrence tree AccountingBlackMarketingSmith DEPTNAMEMANAGER EngineeringCook Bond7 EMPNAMEYRS-SVC DEPARTMENT EMPLOYEE Mills12Hill5Carter3Blake6Case7West6 Programmer2 SKILLCODE SKILL SKILLNAME Analyst5Proj.A3Cost Acct.3Engineer5Proj.B6 PROJNAMEDIV ASSIGNEDTO

Preorder Traversal Method 2.At any point, after recording a segment, record the leftmost child segment of the segment just recorded. If the segment has no child segment, move back up the tree one level and record the leftmost unrecorded child segment of the segment at that level. Continue until all segments are accounted for. 1.Begin at the root of the tree and record the root segment in a file

A BCD FEGHIJK D EEE SS SA AA A Segment type indicator Department Segment Type Employee Segment Type Skill and AssignedTo Segment Type Level 1 Level 2 Level 3 Illustration of Preorder Traversal

The following file will be generated IterationSegmentSegment-Type Indicator 1AD 2BE 3ES 4FA 5GA 6CE 7HS 8IA 9DE 10JS 11KA

The Models Relationship to Conceptual Modeling Transforming a conceptual model to a hierarchical data structure One - Many Relationships

Transforming One-Many Relationships Very simple DEPARTMENT EMPLOYEE HAS- EMPLOYEE 1N DEPTNAMELOCATIONMANAGEREMPNAMEADDRESSYRS-SVC DEPTNAMELOCATIONMANAGER DEPARTMENT EMPNAMEADDRESSYRS-SVC EMPLOYEE

Redundancy problems DEPARTMENT RETIREMENT PLAN HAS- EMPLOYEE 1 N DEPTNAMELOCATIONMANAGERTYPE ENROLL-DATE AMOUNT PROVIDED- FOR EMPLOYEE YRS-SVC ADDRESSEMPNAME 1 N What is the problem?

DEPTNAMELOCATIONMANAGER DEPARTMENT EMPNAMEADDRESSYRS-SVC EMPLOYEE TYPE ENROLL- DATE AMOUNT RETIREMENT-PLAN EMPNAMEADDRESSYRS-SVC EMPLOYEE

1.For each entity set E in a conceptual model, create a segment type S in the hierarchical model. All attributes of E are represented as fields of S. 2.For one-many relationships between two entity sets, create corresponding tree structure diagrams, making each entity a segment and making the one- many relationship a parent-child relationship. The segment on the “many” side becomes the child, and the segment on the one side becomes the parent. The following rules:

Transforming Many-Many Relationships A more complex situation PRODUCT SUPPLIER IS- SUPPLIED- BY N IDDESCRIPTIONPRICE NAME LOCATION M

IDDESCRIPTIONPRICE PRODUCT NAMELOCATION MANUFACTURER IDDESCRIPTIONPRICE PRODUCT NAMELOCATION MANUFACTURER 3.For entity sets, E 1 and E 2, that have a many-many binary relationship, and from which segments S 1 and S 2 have been identified, construct two different one- many PCRs: S 1 to S 2, and S 2 to S 1.

Many-Many Relationship with an Attribute PRODUCT SUPPLIER IS- SUPPLIED- BY N IDDESCRIPTIONPRICE NAME LOCATION M QUANTITY

4.If a binary many-many relationship has attribute data, create a new intersection segment I, which contains that data. IDDESCRIPTIONPRICE PRODUCT NAMELOCATION MANUFACTURER QUANTITY IDDESCRIPTIONPRICE PRODUCT NAMELOCATION MANUFACTURER QUANTITY

The IMS Architecture Hierarchical data model has no standard Must be hierarchically oriented Limit on segment types

Database Description (DBD) Program Specification Block (PSB) Program Communication Block DL/1

Defining the Physical Database – The DBD An example – four segment types –DEPARTMENT –EMPLOYEE –SKILL –ASSIGNEDTO The DBD is analogous to the network schema

1DBDNAME = DEPTPERS, ACCESS = HISAM 2SEGMNAME = DEPARTMENT, PARENT = 0, BYTES = 20 3FIELDNAME = (DEPTNAME,SEQ,U), BYTES = 10, START = 1, TYPE = C 4FIELDNAME = MANAGER, BYTES = 10, START = 11, TYPE = C 5SEGMNAME = EMPLOYEE, PARENT = DEPARTMENT, BYTES = 22 6FIELDNAME = (EMPNAME,SEQ), BYTES = 20, START = 1, TYPE = C 7FIELDNAME = YRS-SVC, BYTES = 2, START = 21, TYPE = P 8SEGMNAME = SKILL, PARENT = EMPLOYEE, BYTES = 17 9FIELDNAME = (SKILLCODE,SEQ), BYTES = 2, START = 1, TYPE = P 10FIELDNAME = SKILLNAME, BYTES = 15, START = 3, TYPE = C 11SEGMNAME = ASSIGNEDTO, PARENT = EMPLOYEE, BYTES = 4 12FIELDNAME = (PROJNI,SEQ), BYTES = 2, START = 1, TYPE = P 13FIELD NAME = DIVISION, BYTES = 2, START = 3, TYPE = C 14DBGEN

Defining the Logical Database – The PSB The PCB Sensitive segments Analogous to the network subschema

PROCOPT G=GET I=INSERT R=REPLACE D=DELETE A=ALL 1PCBTYPE = DB, DBNAME = DEPTERS, PROCOPT = A, KEYLEN = 18 2SENSEGNAME = DEPARTMENT, PARENT = 0 3SENSEG NAME = DEPTNAME, START = 1 4SENSEG NAME = EMPLOYEE, PARENT = DEPARTMENT 5SENFLDNAME = EMPNAME, START = 1

IMS Access Methods HISAM HDAM HIDAM HSAM

DEPTNAME Smith MANAGER Marketing Bond EMPNAME 7 YRS-SVC Hill EMPNAME 5 YRS-SVC Programmer2 SKILLCODESKILLNAME Systems Analyst 5 SKILLCODESKILLNAME Sales10 SKILLCODESKILLNAME Tree Occurrence Example

Hierarchical Pointers DEPTNAME Smith MANAGER Marketing * Bond EMPNAME 7 YRS-SVC * Programmer2 SKILLCODESKILLNAME * Systems Analyst 5 * Hill5 * Sales10 o

Child and Twin Pointers DEPTNAME Smith MANAGER Marketing ** (Twin Pointer) YRS-SVC Bond EMPNAME 7 ** (Child Pointer) SKILLNAME Programmer2 SKILLCODE *o Hill5 o* Systems Analyst 5 oo Sales10 oo

The IMS Data Manipulation Language Program Work Area –Segment templates –Currency templates The language?

GET UNIQUE (GU) GET NEXT (GN) GET NEXT WITHIN PARENT (GNP) GHU, GHN, GHNP INSERT (ISRT) REPLACE (REPL) DELETE (DLET) Retrieve the first segment that satisfies a given condition Retrieve the next segment Retrieves the next segment, but only within the current parent Lock the database for GU, GN, GNP Add a new segment to the database Modify the value of a segment field Delete a segment DL/1 Data Language 1 Commonly used commands Command

1.A Simple Segment Retrieval GU DEPARTMENT (DEPTNAME = ‘Marketing’) Get Unique (GU) 2.Retrieval of a Dependent Segment GU DEPARTMENT (DEPTNAME = ‘Marketing’) EMPLOYEE? (EMPNAME = ‘Steve Smith’)

3.Retrieval of dependent Segment When Parent is Not Known GU DEPARTMENT EMPLOYEE (EMPNAME = ‘Steve Smith’) 4.Retrieval of a Set of Segments GU DEPARTMENT (DEPTNAME = ‘Marketing’) EMPLOYEE GN EMPLOYEE Get Next (GN)

5.Retrieving All Segments of a Particular Type GU DEPARTMENT EMPLOYEE MORE GN EMPLOYEE GOTO MORE 6.Retrieving Segments for Just One Parent GU DEPARTMENT (DEPTNAME = ‘Marketing’) EMPLOYEE GNP EMPLOYEE Get Next Within Parent (GNP)

7.Retrieving Segments for Just One Parent GU DEPARTMENT (DEPTNAME = ‘Marketing’) EMPLOYEE (EMPNAME = ‘Steve Smith’) SKILLS NEXT GNP SKILLS GOTO NEXT GET HOLD UNIQUE GET HOLD NEXT GET HOLD NEXT WITHIN PARENT Get Hold

Replace (REPL) 8.Modifying Segment Field Values GHU DEPARTMENT (DEPTNAME = ‘Marketing’) EMPLOYEE (EMPNAME = ‘Irving Valtz’) MOVE TO SALARY REPL

Delete (DLET) 9.Deleting a Segment GHU DEPARTMENT (DEPTNAME = ‘Marketing’) EMPLOYEE (EMPNAME = ‘Irving Valtz’) DLET

Insert (INSRT) 10.Adding a Segment MOVE 598 TO SKILLCODE MOVE ‘ENGINEERING DRAFTSMAN’ TO SKILLNAME MOVE 0 TO YRS-EXPERIENCE INSRT DEPARTMENT (DEPTNAME = ‘Engineering’) EMPLOYEE (EMPNAME = ‘Bob Lee’) SKILL

1.Data representation Hierarchical Data Model Evaluation 2.Data manipulation language