direct marketing, new york, order catalogtransformers, www.squadron.com, winnie the pooh | ||
Communication Utility | ||
home decor, quilting supplies, fabric care, room furniture | ||
1
|
| Database model |
|---|
| Common models |
|
Hierarchical |
| Other models |
|
Associative |
In a hierarchical data model, data is 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.
Contents |
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.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.
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 geographic, file systems to the Windows registry to XML documents.
In a hierarchical data model, an example of hierarchical database could be displaying the hierarchy of departmental responsibility or \'who reports to whom\'.Chapter 23 \'Logic-Based Databases\' of An Introduction To Database Systems by C.J.Date seventh Edition
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. E.F. Codd after initial criticisms surfaced that the relational model could not model hierarchical data. The ISO SQL standard includes explicit support for retrieving hierarchical data in adjacency list form via Common Table Expressions (CTEs). Another commonly used method of modeling hierarchical data in relational databases is the nested set model, popularized by author Joe Celko.
| Database management systems | |
|---|---|
| Database models · Database normalization · Database storage · Distributed DBMS · Referential integrity · Relational algebra · Relational calculus · Relational database · Relational DBMS · Relational model · Object-relational database · Transaction processing | |
| Concepts | Database · ACID · Null · Candidate key · Foreign key · Primary key · Superkey · Surrogate key |
| Objects | Trigger · View · Table · Cursor · Log · Transaction · Index · Stored procedure · Partition |
| SQL | Select · Insert · Update · Merge · Delete · Join · Union · Create · Drop · Begin work · Commit · Rollback · Truncate · Alter |
| Implementations | Relational · Flat file · Deductive · Dimensional · Hierarchical · Network · Document-oriented · Object-oriented · Object-relational · Temporal · XML data stores |
| Components | Concurrency control · Data dictionary · JDBC · ODBC · Query language · Query optimizer · Query plan |
| Database products: Object-oriented (comparison) · Relational (comparison) · Document-oriented | |
This article is licensed under the GNU Free Documentation License. It uses material from Wikipedia