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:
|
|
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 (16701733)
“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 (16701733)
“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)
“To write it, it took three months; to conceive it three minutes; to collect the data in itall my life.”
—F. Scott Fitzgerald (18961940)
“War is bestowed like electroshock on the depressive nation; thousands of volts jolting the system, an artificial galvanizing, one effect of which is loss of memory. War comes at the end of the twentieth century as absolute failure of imagination, scientific and political. That a war can be represented as helping a people to feel good about themselves, their country, is a measure of that failure.”
—Adrienne Rich (b. 1929)
“O these encounterers, so glib of tongue,
That give a coasting welcome ere it comes,
And wide unclasp the tables of their thoughts
To every ticklish reader! Set them down
For sluttish spoils of opportunity
And daughters of the game.”
—William Shakespeare (15641616)