Hierarchical Database Model - Examples of Hierarchical Data Represented As Relational Tables

Examples of Hierarchical Data Represented As Relational Tables

An organization could store employee information in a table that contains attributes/columns such as employee number, first name, last name, and Department number. The organization provides each employee with computer hardware as needed, but computer equipment may only be used by the employee to which it is assigned. The organization could store the computer hardware information in a separate table that includes each part's serial number, type, and the employee that uses it. The tables might look like this:

EmpNo First Name Last Name Dept. Num
100 Sally Baker 10-L
101 Jack Douglas 10-L
102 Sarah Schultz 20-B
103 David Drachmeier 20-B
Serial Num Type User EmpNo
3009734-4 Computer 100
3-23-283742 Monitor 100
2-22-723423 Monitor 100
232342 Printer 100

In this model, the employee data table represents the "parent" part of the hierarchy, while the computer table represents the "child" part of the hierarchy. In contrast to tree structures usually found in computer software algorithms, in this model the children point to the parents. As shown, each employee may possess several pieces of computer equipment, but each individual piece of computer equipment may have only one employee owner.

Consider the following structure:

EmpNo Designation ReportsTo
10 Director
20 Senior Manager 10
30 Typist 20
40 Programmer 20

In this, the "child" is the same type as the "parent". The hierarchy stating EmpNo 10 is boss of 20, and 30 and 40 each report to 20 is represented by the "ReportsTo" column. In Relational database terms, the ReportsTo column is a foreign key referencing the EmpNo column. If the "child" data type were different, it would be in a different table, but there would still be a foreign key referencing the EmpNo column of the employees table.

This simple model is commonly known as the adjacency list model, and was introduced by Dr. Edgar F. Codd after initial criticisms surfaced that the relational model could not model hierarchical data.The Windows Registry is a hierarchical database that stores configuration settings and options on Microsoft Windows operating systems

Read more about this topic:  Hierarchical Database Model

Famous quotes containing the words examples of, examples, hierarchical, data, represented and/or tables:

    There are many examples of women that have excelled in learning, and even in war, but this is no reason we should bring ‘em all up to Latin and Greek or else military discipline, instead of needle-work and housewifry.
    Bernard Mandeville (1670–1733)

    It is hardly to be believed how spiritual reflections when mixed with a little physics can hold people’s attention and give them a livelier idea of God than do the often ill-applied examples of his wrath.
    —G.C. (Georg Christoph)

    Authority is the spiritual dimension of power because it depends upon faith in a system of meaning that decrees the necessity of the hierarchical order and so provides for the unity of imperative control.
    Shoshana Zuboff (b. 1951)

    Mental health data from the 1950’s on middle-aged women showed them to be a particularly distressed group, vulnerable to depression and feelings of uselessness. This isn’t surprising. If society tells you that your main role is to be attractive to men and you are getting crow’s feet, and to be a mother to children and yours are leaving home, no wonder you are distressed.
    Grace Baruch (20th century)

    Magnitudes are algebraically represented by letter, men by men of letters, and so on.
    Lewis Carroll [Charles Lutwidge Dodgson] (1832–1898)

    It breedeth no small offence and scandal to see and consider upon the one part the curiosity and cost bestowed by all sorts of men upon their private houses; and on the other part the unclean and negligent order and spare keeping of the houses of prayer by permitting open decays and ruins of coverings of walls and windows, and by appointing unmeet and unseemly tables with foul cloths for the communion of the sacrament.
    Elizabeth I (1533–1603)