What is the best view in all opinions for a time-related hierarchy in SQL?
What I mean:
- On any given day, you have a normal tree hierarchy
- This hierarchy can change from day to day
- Each child still has only one parent at any date
Day 1...
Business
|
|-Joe
| |-Happy
| |-Sneezy
| |-Doc(*)
|
|-Moe
|-Bashfull
|-Sleepy
Day 2 ...
Business
|
|-Joe
| |-Happy
| |-Sneezy
|
|-Moe
|-Doc(*)
|-Bashfull
|-Sleepy
At any time, the child can join the hierarchy for the first time or completely leave the hierarchy. (For example, new employees and retired employees.)
Key considerations:
- Hierarchy update
- View the entire hierarchy in a date range
- Reporting for all subtrees within the hierarchy
- Reporting for all sub-ribs in the date range
, , , :)
, ...
( ) ( ) .