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 non-temporal database=== To store the life of John Doe in a current (non-temporal) database we use a table {{code|person (name, address)}}. (In order to simplify, <code>name</code> is defined as the [[primary key]] of <code>person</code>.) John's father officially reported his birth on 1975-04-04. On this date a Smallville official inserted the following entry in the database: <code>Person(John Doe, Smallville)</code>. Note that the date itself is not stored in the database. After graduation, John moves out, but forgets to register his new address. John's entry in the database is not changed until 1994-12-27, when he finally reports it. A Bigtown official updates his address in the database. The <code>person</code> table now contains <code>Person(John Doe, Bigtown)</code>. Note that the information of John living in Smallville has been overwritten, so it is no longer possible to retrieve that information from the database. An official accessing the database on 1994-12-28, would be told that John lives in Bigtown. More technically: if a database administrator ran the query {{code|1=SELECT ADDRESS FROM PERSON WHERE NAME='John Doe'|2=sql}} on 1994-12-26, the result would be <code>Smallville</code>. Running the same query 2 days later would result in <code>Bigtown</code>. Until his death, the database would state that he lived in Bigtown. On 2001-04-01, the coroner deletes the John Doe entry from the database. After this, running the above query would return no result at all. {| class="wikitable" |- !Date!!Real world event!!Database action!!What the database shows |- |style="text-align:right;"|{{nowrap|1975-04-03}}||John is born||{{CNone|Nothing}}||There is no person called John Doe |- |style="text-align:right;"|{{nowrap|1975-04-04}}||John's father officially reports John's birth||Inserted:Person(John Doe, Smallville)||John Doe lives in Smallville |- |style="text-align:right;"|{{nowrap|1994-08-26}}||After graduation, John moves to Bigtown, but forgets to register his new address||{{CNone|Nothing}}||John Doe lives in Smallville |- |style="text-align:right;"|{{nowrap|1994-12-26}}||Nothing||{{CNone|Nothing}}||John Doe lives in Smallville |- |style="text-align:right;"|{{nowrap|1994-12-27}}||John registers his new address||Updated:Person(John Doe, Bigtown)||John Doe lives in Bigtown |- |style="text-align:right;"|{{nowrap|2001-04-01}}||John dies||Deleted:Person(John Doe)||There is no person called John Doe |}
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)