Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Hierarchical database model
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Tree-like structure for data}} {{redirect|Hierarchical model|the statistics usage|Multilevel model|and|Bayesian network}} A '''hierarchical database model''' is a [[data model]] in which the data is organized into a [[Tree data structure|tree]]-like structure. The data are stored as '''records''' which is a collection of one or more '''fields'''. Each field contains a single value, and the collection of fields in a record defines its '''type'''. One type of field is the '''link''', which connects a given record to associated records. Using links, records link to other records, and to other records, forming a tree. An example is a "customer" record that has links to that customer's "orders", which in turn link to "line_items". The hierarchical database model mandates that each child record has only one parent, whereas each parent record can have zero or more child records. The [[network model]] extends the hierarchical by allowing multiple parents and children. In order to retrieve data from these databases, the whole tree needs to be traversed starting from the root node. Both models were well suited to data that was normally stored on [[tape drive]]s, which had to move the tape from end to end in order to retrieve data. When the [[relational database model]] emerged, one criticism of hierarchical database models was their close dependence on application-specific implementation. This limitation, along with the relational model's ease of use, contributed to the popularity of relational databases, despite their initially lower performance in comparison with the existing network and hierarchical models.<ref>Silberschatz, Abraham; Korth, Henry F.; Sudarshan, S. ''Database System Concepts''. 4th ed., McGraw-Hill, 2004, p. 11, 21.</ref> == History == The hierarchical structure was developed by IBM in the 1960s and used in early mainframe [[DBMS]]. Records' relationships form a treelike model. This structure is simple but inflexible because the relationship is confined to a one-to-many relationship. The [[IBM Information Management System]] (IMS) and [[RDM Mobile]] are examples of a hierarchical database system with multiple hierarchies over the same data. The hierarchical data model lost traction as [[Edgar F. Codd|Codd]]'s [[relational model]] became the de facto standard used by virtually all mainstream database management systems. A relational-database implementation of a hierarchical model was first discussed in published form in 1992<ref>[http://www.kamfonas.com/id3.html Michael J. Kamfonas/Recursive Hierarchies: The Relational Taboo!] {{webarchive|url=https://web.archive.org/web/20081108151540/http://www.kamfonas.com/id3.html |date=2008-11-08 }}--The Relation Journal, October/November 1992</ref> (see also [[nested set model]]). Hierarchical data organization schemes resurfaced with the advent of [[XML]] in the late 1990s<ref>{{Cite web|url=http://www.ibm.com/developerworks/xml/library/x-matters8/index.html|title=Web Application Development|website=[[IBM]] }}</ref> (see also [[XML database]]). The hierarchical structure is used primarily today for storing geographic information and file systems.{{citation needed|date=March 2013}} Currently, hierarchical databases are still widely used especially in applications that require very high performance and availability such as banking, health care, and telecommunications. One of the most widely used commercial hierarchical databases is IMS.<ref>[https://web.archive.org/web/20120403013022/http://www-03.ibm.com/ibm/history/ibm100/us/en/icons/ibmims/ IBM Information Management System]</ref> Another example of the use of hierarchical databases is [[Windows Registry]] in the [[Microsoft Windows]] operating systems.<ref>{{cite web | url=http://msdn.microsoft.com/en-us/library/windows/desktop/ms724946(v=vs.85).aspx | title=Structure of the Registry - Win32 apps }}</ref> == Examples of hierarchical data represented as relational tables == An organization could store employee information in a [[table (database)|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: {| |- | {| class="wikitable" |+ <code>employee</code> table ! EmpNo !! First Name !! Last Name !! Dept. Num |- | 100 || Almukhtar || Khan || 10-L |- | 101 || Gaurav || Soni|| 10-L |- | 102 || Siddhartha || Soni || 20-B |- | 103 || Siddhant || Soni || 20-B |} | {| class="wikitable" |+ <code>computer</code> table ! 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 <code>employee</code> data table represents the "parent" part of the hierarchy, while the <code>computer</code> 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: {| class="wikitable" |- ! 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.{{citation needed|date=May 2018}} However, the model is only a special case of a general [[adjacency list]] for a graph. == See also == * [[Tree structure]] * [[Hierarchical query]] * [[Hierarchical clustering]] == References == {{reflist}} == External links == {{Commons category|Hierarchical models}} * [http://troels.arvin.dk/db/rdbms/links/#hierarchical Troels' links to Hierarchical data in RDBMSs] * [https://web.archive.org/web/20110606032941/http://dev.mysql.com/tech-resources/articles/hierarchical-data.html Managing Hierarchical Data in MySQL] (This page is from archive.org as the page has been removed from MySQL.com) * [http://explainextended.com/2009/07/20/hierarchical-data-in-mysql-parents-and-children-in-one-query/ Hierarchical data in MySQL: parents and children in one query] * [http://unifosys.com/hierarchy-chart/Create_Organization_Chart_from_Mutiple_Tables.html Create Hierarchy Chart from Hierarchical Database] {{Database models}} {{DEFAULTSORT:Hierarchical Model}} [[Category:Database models]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Citation needed
(
edit
)
Template:Cite web
(
edit
)
Template:Commons category
(
edit
)
Template:Database models
(
edit
)
Template:Redirect
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Webarchive
(
edit
)