Valid-Time Table

A temporal database supports multiple version of rows. Dealing with multiple versions can be quite complicated. A number of DBMS vendors have added support for temporal support.

As an example of a valid-time table consider the emp is shown below.

Name Dept VTS VTE
Karen RD 10 20
Karen HR 20 30
Søren RD 15 45

The content of the table emp can be explained as follows.

  • In the interval [10, 20) Karen was in the RD department
  • At time 20 Karen moved to the HR department and is there until time 30
  • Søren is with the RD department in the interval [15, 45)

To create this table the following SQL command are created.

-- create the table
create table emp(
    name varchar(50) not null,
    dept varchar(50) not null,
    vts  integer     not null,
    vte  integer     not null);

-- Insert the data
insert into emp values('Karen', 'RD', 10, 20);
insert into emp values('Karen', 'HR', 20, 30);