Hierarchical Database Structure
Summary
Hierarchical database structure is similar to tree structure. It follows inverted tree structure.
IMSDB Structure Diagram -
The tree structure consists of multiple levels. Each is level is indirectly dependent on the upper level of the structure. The structure can be explained by the simple example like a company structure.
The C.E.O of the company controls all the employees of the company and the next level employees mainly and the next level controls the next level and so on to last level.
In the above diagram, Level1 is the top and no upper level for level1. Level1 controls level2 and as well as level3. But level2 is directly linked to level1 as a below level.
Level2 controls level3 and controlled by level1.IMS Database contains hierarchy level and each hierarchical level contains segments.
IMSDB Structure Example:
Fields -
A field is a data item which can be used to create the Segment. A field contains the information about the entity. A field can be used as part of key to search the segment.
A field can be used to order the segments. In the above example, Emp number, emp name are the fields of EMPLOYEE segment.
SEGMENT -
Smallest unit of data that an application can retrieve form a database. Contains one or more fields of data.In other words, Segment is created by similar data items together.
A segment is a combination of one or more data items combined together. A segment is the smallest unit passed from the application program to perform the transaction. In the above example, there are three segments.
- Company
- Employee information ( Combination of two data items emp number, emp name)
- Project information ( Combination of two data items proj number, proj name)
Segment can consists small data items called as Fields. Segment can be created with a single field or a combination of more than one field.