What in everyone\'s opinion is the best representation for a time-bound hierarchy in SQL?
What I mean by this is:
- On any given date you have a normal tree hierarch
table item(id, ...)
table item_link(parent_item, child_item, from_date, until_date)
The links will store the representation of the tree for a certain time
This structure represents a network instead of a plain hierarchy but it supports moving things in a hierarchy but also look back in time. Some things need to be checked in application logic is to disallow joe being linked at different places in the hierarchy at the sametime.
Reporting is relatively easy with connect by prior clause (in oracle)
Other details can be related to item or even item link if it is to specify additional data on the relation.