bradgrafelman;10971259 wrote:Why is that?
The reason (I think) is to make things more user-friendly, so the user doesn't stuff up the history of the team name.
In the 3rd example I gave:
"-Adjust the "Eagles" name to start in 1997 instead of 1996"
The update command would need to do the following:
1) Update the "Eagles" record to change the the start date from 1996 to 1997
2) Find the previous name record (i.e. the one with an end date of 1996, i.e "Hawks") and change this end date to 1997.
By doing this, there is never a period in time where the team has no name assigned to it. The "Hawks" team name would have an end date of "1996-12-31 23:59:59" and the "Eagles" team name would have a start date of "1997-01-01 00:00:00". The latest/current team name would obviously have an end date of NULL.
See what I mean? Also, the more complicated you get the more you have to adjust other records, e.g. if you wanted to adjust the history to make it that in 1992 the team was knows as the "Sparrows" then you'd have to:
1) Update the "Hawks" record to set the end date to "1991-12-31 23:59:59"
2) Insert the new "Sparrows record from "1992-01-01 00:00:00" to "1992-12-31 23:59:59"
3) Either:
a) Find the closest name record in the future (i.e. "Eagles" and set the start date to "1993-01-01 00:00:00"; OR
b) Insert a new record (called "Hawks" again) and set the start date to "1993-01-01 00:00:00" and the end date to be the same as the start date as the next closest name record in the future (i.e. "Eagles").
Just to explain 3a and 3b a bit better, here is what the history would look like under each:
3a
Hawks (1990 - 1992)
Sparrows (1992 - 1993)
Eagles (1993 - 1999)
Parrots (1999 - NULL)
3b
Hawks (1990 - 1992)
Sparrows (1992 - 1993)
Hawks (1993 - 1997)
Eagles (1997 - 1999)
Parrots (1999 - NULL)
See what I mean? Things get a bit complicated... or am I over-complicating this?