Questions tagged [hierarchy]

For issues relating to arranging items into ordered levels.

A hierarchy is an arrangement of items (objects, names, values, categories, resources, etc.) in which the items are conceptually "above," "below," or "at the same level as" one another. Abstractly, a hierarchy is simply an ordered set or an directed acyclic graph.

The items being organized are normally refereed to as nodes, entities, or elements. A hierarchy can link entities directly or indirectly, and either vertically or horizontally. The only direct links necessary to establish hierarchy are to node's immediate superior (ie. "parent"), or to the node's subordinates (ie. "children").

However, more complex relationships can be inferred through indirect linkage, or linkage by proxy of other nodes. Conceptually, you don't have to link to a node's grandparent, it can be inferred that the parent's parent is a grandparent. Conversely, a sibling -- related horizontally to the node -- can be said to be any child of your parent and likewise no "direct" linkage is required.

182 questions
3
votes
1 answer

How do hierarchical databases records link together?

If I had a hierarchical database containing 3 tables: course, students, grades Course would be the root table and may have 10 course records in there. Each course has its own selection of students, if the record doesn't contain keys like a…
simon
  • 31
  • 1
1
vote
2 answers

How to correctly create a table that has multiple columns self reference another row?

EmpNo |Designation | ReportsTo | Room 10 | Director | NULL | 1 20 | Senior Manager | 10 | 2 30 | Typist | 20 | (THIS GUY REFERS TO empno 10 room) 40 | Programmer | 30 | 4 How do I…
1
vote
0 answers

Model a tree that belongs to a row in another table

Given the tables "users" and "nodes" (which will contain an adjacency list tree) what is the best way to link these tables (each user has a tree). Putting the column "user_id" in the "nodes" table seems very ineffective to me, but I couldn't find…
0
votes
1 answer

Database for inheritance hierarchy queries

I'm looking for a way to store hierarchical data, in a way that will facilitate "inheritance" queries that will coalesce upwards in the hierarchy. Simple example: Level 1, property X = 123 - Level 2, property x = null - - Level 3, property x =…