0% found this document useful (0 votes)
60 views23 pages

Dbms Presentation

Temporal databases store data relating to time and allow querying of data at different points in time. They add time dimensions like valid time and transaction time to tables. Valid time represents when facts were true in reality, while transaction time represents when data was stored in the database. Temporal databases are useful for applications like financial, medical, and reservation systems that require recording the change of data over time. They provide time-varying or historical views of data.

Uploaded by

Avik Chakraborti
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views23 pages

Dbms Presentation

Temporal databases store data relating to time and allow querying of data at different points in time. They add time dimensions like valid time and transaction time to tables. Valid time represents when facts were true in reality, while transaction time represents when data was stored in the database. Temporal databases are useful for applications like financial, medical, and reservation systems that require recording the change of data over time. They provide time-varying or historical views of data.

Uploaded by

Avik Chakraborti
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Temporal Database

- Avik Chakraborti(CS0905)and Nilanjan Dutta(CS0901)

Temporal Database

Temporal database stores data relating to time instances. It offers temporal data types and stores information relating to past, present and future time.

Example: The history of the stock market

Brief Overview on Architecture


User Query Interface Middlewire Results

Requests RDBMS

Results

Why Do We Need Temporal Database

The relational data model as proposed by Codd [Cod70] does not address the temporal dimension of data.

In fact, most application require temporal data to a certain extent.

The Main Goals of Temporal Database

Identification of an appropriate data type for time. Provide query algebra to deal with temporal data. Compatiable with old database without temporal data.

What Can be Done by Temporal Database

It's easy to deal with temporal data Record the data changed with time is more convenient Having relation model to describe temporal data Having query algebra to deal with temporal data

What Can be Done by Temporal Database

It works that to handle static data (without time dimension) in temporal database. The tranditional database algebra still work in temporal database. The new query algebra to control time dimemsion is similar to tranditional database algebra.

Different Solutions About Temporal Database

Add Valid Time ( Valid Time or Historical DB) Add Transaction Time ( Transaction Time or RollBack DB) Add Both of above ( Bitemporal DB)

Application domains of Temporal Data

Financial Applications e.g. history of stock markets; share prices. Reservation Systems e.g. when was a flight booked. Medical Systems e.g. patient records. Computer Applications e.g. history of file back ups.

Temporal Dimension
A temporal database is a database system that provides special support for handling data with a temporal component, namely time. The important issue that needs to be addressed for creating a temporal database is the representation or modelling of time.

Time Views
Views of time can be considered to be either
1) Continuous Time.(Very Problematic to represent) 2) Discrete Time.( Implemented in terms of 'Chronon')

Temporal Database Forms and Data Model


Another important issue relating to the representation of time is the role played by the time. There are two common perceptions of time,
1)Transaction time 2)valid time

Valid Time
The valid time of a database object is the time when the object is effective or holds (is true) in reality . The time when the event occurred, took place in reality.
Example:- in a football competition, when did the clubs win the competition i.e. the times when Arsenal won the F.A Cup competition.

Transaction Time
The transaction time of an object is the time when the object is stored in the database, the time that it is present in the database.
Example:- In a company situation, an employee receives a pay rise but it comes into effect when the payroll clerk enters this salary rise into the database.

Sample Table
Consider the following table Person
Date
April 3, 1975 April 4, 1975 August 26, 1994 What Happened in the Real World John is born
John's father officially reports John's birth After graduation, John moves to Bigtown, but forgets to register his new address

Database Action Nothing


Inserted:Person(John Doe, Smallville)

What the database shows There is no person called John Doe John Doe lives in Smallville John Doe lives in Smallville John Doe lives in Smallville John Doe lives in Bigtown There is no person called John Doe

Nothing

December 26, 1994 December 27, 1994 April 1, 2001

Nothing John registers his new address John dies

Nothing
Updated:Person(John Doe, Bigtown) Deleted:Person(John Doe)

Valid Time Database


In the example , the Person table gets two extra fields, Valid-From and Valid-To, specifying when a person's address was valid in the real world.
Here on April 4,1975

Person(John Doe, Smallville, 3-Apr-1975, )


field is inserted in the database. Valid-To field is set to be ''.

Valid Time Database(continued)


December 27, 1994 John reports his new address in Bigtown where he has been living since August 26, 1994.

Here on December 27, 1994

Person (John Doe, Big Town, 26-Aug-1994, ).


field is inserted in the database.

Valid Time Database(continued)


The original entry Person (John Doe, Smallville, 3-Apr1975, ) is then updated. Since it is now known that John stopped living in Smallville on August 26, 1994 the Valid-To entry can be filled in. The database now contains: Person(John Doe, Smallville, 3-Apr-1975, 26-Aug-1994). Person(John Doe, Bigtown, 26-Aug-1994, ).

Valid Time Database(continued)


When John dies the database is once more updated. The current entry will be updated stating that John does not live in the Bigtown any longer. The database now looks like this: Person(John Doe, Smallville, 3-Apr-1975, 26-Aug-1994). Person(John Doe, Bigtown, 26-Aug-1994, 1-Apr-2001).

Transaction Time Database

Transaction time is the time a transaction was made. Enables queries that show the state of the database at a given time. Transaction-From and Transaction-To fields will be added to the Person table. Transaction-From is the time a transaction was made. Transaction-To is the time that the transaction was superseded (or infinity if it has not yet been superseded).

Transaction Time Database( Continued)


Question:
What happens if the person's address as stored in the database is incorrect?

Answer:
Upon discovery of the fact, the officials go back and update the database

Transaction Time Database( Continued)

Example: From 1-Jun-1995 to 3-Sep-2000 John Doe moved to Beachy. But, to


avoid paying Beachy's exorbitant residence tax, he never reported it. Later, it is discovered on 2-Feb-2001, so the database is updated as follows: Person(John Doe, Bigtown, 26-Aug-1994, 1-Jun-1995). Person(John Doe, Beachy, 1-Jun-1995, 3-Sep-2000). Person(John Doe, Bigtown, 3-Sep-2000, 1-Apr-2001).

Transaction Time Database( Continued)


The previous scenario leaves no record that the database ever claimedd that he lived in Bigtown during 1-Jun-1995 to 3-Sep-2000. This is where transaction time comes in. Thus the database is updated as follows:

Person(John Doe, Smallville, 3-Apr-1975, , Person(John Doe, Bigtown, 26-Aug-1994, , Person(John Doe, Beachy, 1-Jun-1995,

4-Apr-1975, 27-Dec-1994 ). ). ). ). ). 27-Dec-1994, 2-Feb-2001 ).

Person(John Doe, Smallville, 3-Apr-1975, 26-Aug-1994, 27-Dec-1994, Person(John Doe, Bigtown, 26-Aug-1994, 1-Jun-1995, 2-Feb-2001, 3-Sep-2000, 2-Feb-2001, Person(John Doe, Bigtown, 3-Sep-2000, ,

2-Feb-2001, 1-Apr-2001 ).

Person(John Doe, Bigtown, 3-Sep-2000, 1-Apr-2001, 1-Apr-2001,

You might also like