Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 176129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:49:18+00:00 2026-05-11T13:49:18+00:00

What in everyone’s opinion is the best representation for a time-bound hierarchy in SQL?

  • 0

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 hierarchy
– This hierarchy can change from day to date
– Each child still only has one parent on any given date

Day 1…

Business  |  |-Joe  |  |-Happy  |  |-Sneezy  |  |-Doc(*)  |  |-Moe     |-Bashfull     |-Sleepy 

Day 2…

Business  |  |-Joe  |  |-Happy  |  |-Sneezy  |  |-Moe     |-Doc(*)     |-Bashfull     |-Sleepy 

At any time, a child can join the hierarchy for the first time, or leave the hierarchy completely. (For example, new employees, and retired employees.)

The main considerations:

  • Updating the hierarchy
  • Viewing the whole hierarchy across a date range
  • Reporting on whole sub-trees within the hierarchy
  • Reporting on whole sub-trees across a date range

I know how I do it at present, but am intrigued as to how other people may do it 🙂

EDIT

I naively assumed a few considerations so will be more explicit…

  • Each ‘team’ or ‘person’ will have a unique ID in a dimension table elsewhere
  • Other fact tables will use those IDs (storing performance metrics, for example)
  • The structure needs to facilitate historical reporting across date ranges
  • Use of ETL or triggers to maintain alternative structures Is an option

The generic nature is most important (forming just one part of a generic relational mode), combined with ease of use for driving report (for any part of the tree across any range of dates) and the ability to be updated reliably.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T13:49:19+00:00Added an answer on May 11, 2026 at 1:49 pm

    There are several different books of relevance here – one set is for ‘temporal databases’, and the other for ‘hierarchical structures in RDBMS’.

    • Snodgrass "Developing Time-Oriented Applications in SQL" (PDF available online at URL)
    • Date, Darwen and Lorentzos "Temporal Data and the Relational Model"
    • Celko "Joe Celko’s Trees and Hierarchies in SQL for Smarties"

    The tricky parts of your question, it seems to me, are:

    • Viewing the whole hierarchy across a date range

    • Reporting on whole sub-trees across a date range

    The other items are, if not straight-forward, then manageable using the techniques outlined in the books, and along the lines suggested in other answers. Part of the problem is understanding what those two bullet points mean. In one sense, they are ‘the same’; the ‘whole hierarchy’ is just a special case of ‘whole sub-trees’. But the deeper question is ‘how do you want to demonstrate – visualize, represent – the changes in the hierarchy over time?’ Are you seeking to compare the states at the start and end times, or are you seeking to see the intermediate changes too? How do you want to represent the moves of an individual within a hierarchy?

    More questions than answers – but I hope the pointers are some help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 237k
  • Answers 237k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer IIS Uses a seperate downloadable plug that will first need… May 13, 2026 at 6:36 am
  • Editorial Team
    Editorial Team added an answer What about e.Control.EditingControlDataGridView.CurrentCell.ColumnIndex? Or maybe just DGV.CurrentCell.ColumnIndex? May 13, 2026 at 6:36 am
  • Editorial Team
    Editorial Team added an answer This condition System.Tuple.Create(3,3).Equals(myTuple) seems to work for me. (Note that… May 13, 2026 at 6:36 am

Related Questions

What in everyone's opinion is the best representation for a time-bound hierarchy in SQL?
The idea of storing connection strings in a data base is a perverse idea,
For as long as I can remember I have avoided using switch statement fall-through.
What I am looking for is a way to call a method after another
I have created an application which needs 'hand-over' to the support group in the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.