Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Temporal database
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Using a single axis: valid time or transaction time=== {{Main article|Valid time}}[[Valid time]] is the time for which a fact is true in the real world. A valid time period may be in the past, span the current time, or occur in the future. For the example above, to record valid time, the <code>person</code> table has two fields added, <code>valid_from</code> and <code>valid_to</code>. These specify the period when a person's address is valid in the real world. On 1975-04-04, John's father registered his son's birth. An official then inserts a new entry into the database stating that John lives in Smallville from April 3. Note that although the data was inserted on the fourth, the database states that the information is valid since the third. The official does not yet know if or when John will move to another place, so the <code>valid_to</code> field is set to [[infinity]] (β). The entry in the database is: {| class="wikitable" !Name !City !Valid from !Valid to |- |John Doe |Smallville |1975-04-03 |β |} On 1994-12-27, John reports his new address in Bigtown where he has been living since 1994-08-26. A new database entry is made to record this fact: {| class="wikitable" !Name !City !Valid from !Valid to |- |John Doe |Bigtown |1994-08-26 |β |} The original entry <code>Person (John Doe, Smallville, 1975-04-03, β)</code> is not deleted, but has the <code>valid_to</code> attribute updated to reflect that it is now known that John stopped living in Smallville on 1994-08-26. The database now contains two entries for John Doe: {| class="wikitable" !Name !City !Valid from !Valid to |- |John Doe |Smallville |1975-04-03 |1994-08-26 |- |John Doe |Bigtown |1994-08-26 |β |} When John dies his current entry in the database is updated stating that John does not live in Bigtown any longer. The database now looks like this: {| class="wikitable" !Name !City !Valid from !Valid to |- |John Doe |Smallville |1975-04-03 |1994-08-26 |- |John Doe |Bigtown |1994-08-26 |2001-04-01 |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)