TimeConsult

What are Temporal Database Management Systems?

Non-Temporal DBMS

Commercial database management systems (DBMS) such as Oracle, Sybase, Informix andO2 are non-temporal DBMS since they do not support the management of temporal data. A temporal DBMS should support temporal data definition language, a temporal data manipulation language and a temporal query language, temporal constraints.

Although some of the DBMS support data types for dates and time, they cannot be considered to be temporal DBMS. For example, the specification of a query considering several different database states (the history of data) is left to the user, without any support by the system.

Temporal DBMS

A temporal DBMS such as TimeDB supports
  1. a temporal data definition language,
  2. a temporal data manipulation language,
  3. a temporal query language, and
  4. temporal constraints (such as temporal referential integrity).
TimeDB supports SQL, however in an extended form. Basically, two keywords are added (VALIDTIME and TRANSACTIONTIME).

Below you find a short introductionto the language SQL/Temporal used in TimeDB. More details about the implementation of TimeDB and the supported language can be found in[Ste98], [SBJS96a], [SBJS96b].

Temporal Data Definition Language

In TimeDB, a bitemporal table can be created the following way:
    CREATE TABLE Employees (EmpID INTEGER, Name CHAR(30), Department CHAR(40), Salary INTEGER)
    AS VALIDTIME AND TRANSACTIONTIME;

Temporal Data Manipulation Language

The following statement inserts temporal data about John:
    VALIDTIME PERIOD '1985-1990'
    INSERT INTO Employees VALUES (10, 'John', 'Research', 11000);

    VALIDTIME PERIOD '1990-1993'
    INSERT INTO Employees VALUES (10, 'John', 'Sales', 11000);

    VALIDTIME PERIOD '1993-forever'
    INSERT INTO Employees VALUES (10, 'John', 'Sales', 12000);

Temporal Query Language

To query the data, the same keywords are used:
    VALIDTIME
    SELECT * FROM Employees;
This query returns the history of the employees with respect to valid time (when were they employed). The following query finds out when the tuples in table Employees were stored in the database :
    TRANSACTIONTIME
    SELECT * FROM Employees;
To find out both valid time and transaction time, a combination of the keywords can be used:
    VALIDTIME AND TRANSACTIONTIME
    SELECT * FROM Employees;
In fact, any legal standard SQL query can be extended with one of the combinations VALIDTIME, TRANSACTIONTIME or VALIDTIME AND TRANSACTIONTIME.

Temporal Constraints

Temporal integrity constraints can be expressed similarly. For example, a referential integrity constraint demanding that at each time instant an employee is a member of a department, the corresponding department itself must exist, can be expressed the following way:
    CREATE TABLE Employees (EmpID INTEGER, Name CHAR(30), Department CHAR(40) VALIDTIME REFERENCES Departments(department), Salary INTEGER) AS VALIDTIME AND TRANSACTIONTIME;


Back to overview