Hierarchical model
From Wikipedia, the free encyclopedia
Database models |
---|
Common models |
Hierarchical |
Other models |
Associative |
In a hierarchical data model, data are organized into a tree-like structure. The structure allows repeating information using parent/child relationships: each parent can have many children but each child only has one parent. All attributes of a specific record are listed under an entity type. In a database, an entity type is the equivalent of a table; each individual record is represented as a row and an attribute as a column. Entity types are related to each other using 1: N mapping, also known as one-to-many relationships.
An example of a hierarchical data model would be if an organization had records of employees in a table (entity type) called "Employees". In the table there would be attributes/columns such as First Name, Last Name, Job Name and Wage. The company also has data about the employee’s children in a separate table called "Children" with attributes such as First Name, Last Name, and DOB. The Employee table represents a parent segment and the Children table represents a Child segment. These two segments form a hierarchy where an employee may have many children, but each child may only have one parent.
Hierarchical structures were widely used in the first mainframe database management systems. Hierarchical relationships between different types of data can make it very easy to answer some questions, but very difficult to answer others. If a one-to-many relationship is violated (e.g. a patient can have more than one physician), then the hierarchy becomes a network.[1]
The most common form of hierarchical model used currently is the LDAP model. Other than that, the hierarchical model is rare in modern databases. It is, however, common in many other means of storing information, ranging from file systems to the Windows registry to XML documents.
Contents |
[edit] Tree Data structure in Relational Model
In Relational Database model, an example of hierarchical data could be displaying the hierarchy of departmental responsibility or 'who reports to whom'.[2]
Consider the following table:
EmpNo | Designation |
---|---|
10 | Director |
20 | Senior Manager |
30 | Typist |
40 | Programmer |
Their hierarchy stating EmpNo 10 is boss of 20 and 30,40 report to 20 is represented by following table:
BossEmpNo | ReportingEmpNo |
---|---|
10 | 20 |
20 | 30 |
20 | 40 |
In the example above if a person does not report to 2 bosses then the tree of hierarchy is of type 'A child has only one parent'. Now, let us see the hierarchy of 'A child with many parents'. The simple example is the 'Bill Of Material' of Engineering Assembly.
A Car Engine could have 2 different assemblies both having similar parts.
Consider the following table:
PartNum | Description |
---|---|
10 | CrankAssembly |
20 | HeadAssembly |
30 | ConnectingRod |
40 | Crank Shaft |
90 | 3/4 Dia Bolt |
Assembly Hierarchy is described in the following table,
Parent_PartNum | Child_PartNum |
---|---|
10 | 30 |
10 | 90 |
20 | 40 |
20 | 90 |
...... |
PartNum 90 has 2 parents, as it is present in both assemblies.
[edit] References
- ^ White, Basil (1996) Developing Products and Their Rhetoric from a Single Hierarchical Model, 1996 Proceedings of the Annual Conference of the Society for Technical Communication, 43, 223-224.
- ^ Chapter 23 'Logic-Based Databases' of An Introduction To Database Systems by C.J.Date seventh Edition
[edit] External links
- Hierarchical databases at the Open Directory Project (suggest site)
- Hierarchies
- Managing hierarchical data in relational databases
- Mumps Compiler
- C++ Hierarchical Toolkit
[edit] Some Well-known Hierarchical Databases
- Adabas
- GT.M
- IMS
- MUMPS
- Caché (software)
- Metakit
- Multidimensional hierarchical toolkit
- Mumps compiler
- DMSII
- FOCUS