Professional Documents
Culture Documents
ETCS-423
CASE STUDY - 2
Submitted to Submitted By
Ms. Sakshi Jindal Anmol Saxena
65311502716
1. INTRODUCTION
A temporal database stores data relating to time instances. It offers temporal data types and
stores information relating to past, present and future time. Temporal databases could be uni-
temporal, bi-temporal or tri-temporal. Assume we would like to store data about our
employees with respect to the real world. Then, the following table could result:
The above valid-time table stores the history of the employees with respect to the real world.
The attributes Valid Time Start and Valid Time End actually represent a time interval
which is closed at its lower and open at its upper bound. Thus, we see that during the time
period [1985 - 1990), employee John was working in the research department, having a salary
of 11000. Then he changed to the sales department, still earning 11000. In 1993, he got a
salary raise to 12000. The upper bound INF denotes that the tuple is valid until further notice.
Note that it is now possible to store information about past states. We see that Paul was
employed from 1988 until 1995. In the corresponding non-temporal table, this information
was (physically) deleted when Paul left the company.
More specifically the temporal aspects usually include valid time, transaction
time or decision time
Valid time is the time period during which a fact is true in the real world.
Transaction time is the time period during which a fact stored in the database was
known.
Decision time is the time period during which a fact stored in the database was
decided to be valid.
As we mentioned above, commercial DBMS are said to store only a single state of the real
world, usually the most recent state. Such databases usually are called snapshot databases. A
snapshot database in the context of valid time and transaction time is depicted in the
following picture:
Fig. 1 represents valid time and transaction time
On the other hand, a bitemporal DBMS such as Time DB stores the history of data with
respect to both valid time and transaction time. Note that the history of when data was stored
in the database (transaction time) is limited to past and present database states, since it is
managed by the system directly which does not know anything about future states.
A table in the bitemporal relational DBMS Time DB may either be a snapshot table (storing
only current data), a valid-time table (storing when the data is valid wrt. the real world), a
transaction-time table (storing when the data was recorded in the database) or a bitemporal
table (storing both valid time and transaction time). An extended version of SQL allows to
specify which kind of table is needed when the table is created. Existing tables may also be
altered (schema versioning). Additionally, it supports temporal queries, temporal
modification statements and temporalconstraints.
The states stored in a bitemporal database are sketched in the picture below. Of course, a
temporal DBMS such as Time DB does not store each database state separately as depicted in
the picture below. It stores valid time and/or transaction time for each tuple, as
described above.
2.1 Uni-Temporal
A uni-temporal database has one axis of time, either the validity range or the system time
range.
2.2 Bi-Temporal
A bi-temporal database has two axis of time.
valid time.
transaction time or decision time.
2.3 Tri-Temporal
A tri-temporal database has three axes of time.
valid time.
transaction time
decision time.
This approach introduces additional complexities.
Temporal databases are in contrast to current databases (not to be confused with currently
available databases), which store only facts which are believed to be true at the current time.
3. Features
Temporal databases support managing and accessing temporal data by providing one or more
of the following features:
A time period datatype, including the ability to represent time periods with no end
(infinity or forever)
The ability to define valid and transaction time period attributes and bitemporal
relations
System-maintained transaction time
Temporal primary keys, including non-overlapping period constraints
Temporal constraints, including non-overlapping uniqueness and referential integrity
Update and deletion of temporal records with automatic splitting and coalescing of
time periods
Temporal queries at current time, time points in the past or future, or over durations
Predicates for querying time periods, often based on Allen’s interval relations
Fi