Database Reference
In-Depth Information
and complexity of the application programs. It was this very problem that provided com-
puter scientists of the day with the incentive to find a better way to organize data.
2.1.2 The Hierarchical Model
The hierarchical database model is an inverted tree-like structure. A tree-structure diagram
is the schema for a hierarchical database. Such a diagram consists of two basic components:
1. Boxes , which correspond to record types
2. Lines , which correspond to links
A hierarchical database consists of a collection of records that are connected to each other
through links. Each record is a collection of fields (attributes), each of which contains only
one data value. A link is an association between precisely two records. The tables of this
model take on a child-parent relationship. Each child table has a single parent table , and
each parent table can have multiple child tables. Child tables are completely dependent
on parent tables; therefore, a child table can exist only if its parent table does. It follows
that any entries in child tables can only exist where corresponding parent entries exist in
parent tables. All relationships between records in a hierarchical model have a cardinality
of one-to-many or one-to-one, but never many-to-one or manyto-many. The most popular
hierarchical database was Information Management System (IMS) from IBM.
Root File (Parent)
Parent Files
(Child to Root)
Children Files (Child to Parent)
There are, of course, several other ways of making the parent-child link. Each method has
advantages and disadvantages, but imagine the difficulty with the linked list system if you
wanted to have multiple parents for each child record. Also note that some system must be
chosen to be implemented in the underlying database software. Once the linking system is
chosen, it is fixed by the software implementation; the way the link is done has to be used
to link all child records to parents, regardless of how inefficient it might be for one situ-
ation.
Example: 1
Following figure shows an example hierarchical database model. So, for example, there is
a one-to-many relationship between Customer and Order because there may multiple order.
We cannot search for an order detail without first finding the customer, and then order.
Order
Search WWH ::




Custom Search