International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 04 Issue: 09 | Sep -2017 www.irjet.net p-ISSN: 2395-0072

SQL and Temporal Research: Unified Review and Directions

Rose-Mary Owusuaa Mensah1, Vincent Amankona2

1Postgraduate Student, Kwame Nkrumah University of Science and Technology, Kumasi, Ghana 2 Postgraduate Student, Kwame Nkrumah University of Science and Technology, Kumasi, Ghana ------***------Abstract - Several attempts to incorporate temporal In the early 1990s, a renowned researcher in the database extensions into the Structured Query Language, SQL, one of community, Richard Snodgrass, proposed that temporal the most popular query languages for date back extensions to SQL be developed because few of them to the nineteenth and twentieth century. Although a lot of existed. In response to his proposal [1], a committee was work and research has been done on temporal databases formed to consolidate research and suggestions from and SQL, there exist very limited literature clearly outlining the research community in order to design temporal the various events which have taken place with regards to extensions to the 1992 edition of the SQL standard. Those temporal extensions of SQL over the years till the extensions, known as TSQL2, were then developed by this state in a concise document. Consequently, researchers need committee and in 1993, they presented proposals to the to gather several pieces of literature before they can obtain ANSI SQL Technical Committee. Based on responses to the a vivid pictorial of the and the current state proposals, changes were made to the Language, and the of these temporal extensions for research and software definitive version of the TSQL2 Language Specification development purposes. In order to align current research was published as a technical report in September, 1994 with that from the past, there is the need for a consolidation [2]. of information. In this paper, we seek to present the past and current state of temporal support in relational databases Almost five years later, a new standard SQL:1999 [3] was and also describe the various attempts and proposals to to be released and attempts were made to include a introduce temporal extensions into SQL over the years, substandard, SQL/Temporal [4], which comprised parts of discuss their level of success and impact on the most recent the TSQL2 specification. SQL/Temporal failed to make it to SQL standard. We also identify desirable temporal features the SQL:1999 standard because the TSQL2 approach was which have not yet been introduced into any of the SQL heavily criticized. After the unsuccessful attempt, standards and also determine the level of acceptance of the researchers continued to propose features to extend the available SQL temporal extensions by some commercial SQL syntax for temporal support. A decade later, a new database management system vendors. standard SQL:2011[5] has been developed, which provides a substantive support for temporal data management by introducing system-versioned tables, Key Words: SQL, temporal, databases, SQL:2011, DBMS, application- period tables and bitemporal tables. TSQL2,SQL-92 Although a lot of work and research has been done on 1. INTRODUCTION temporal databases, there exists very limited literature which clearly outlines the various events which have Different users and applications have diverse taken place with regards to temporal extensions of SQL requirements and as such wish to access data at different over the years till the present state in a single document. points in time; this requires a form of database Researchers need to gather several pieces of literature management system which is able to keep track of past, before they can obtain a vivid pictorial timeline of the current and future states of data. Many computer history and the current state of these temporal extensions, applications, such as banking, inventory control, law, for research and software development purposes. It is for medical records and airline reservations deal with time this reason that this paper seeks to provide a state-of-the- varying information: hence it is important that database art survey on the temporal extensions of SQL, identify any management systems, DBMSs, are designed to be able to drawbacks of the current extensions and present further handle the temporal information. A database which research being conducted in this area. The survey provides in-built support for time is referred to as a conducted addresses the questions below: . Researchers have engaged in the study of temporal concepts in databases over the years and have  Which temporal features are available in the written various scientific papers, articles and books in this various SQL standards? area.  What are the key activities and research which have been undertaken in the field of temporal

© 2017, IRJET | Impact Factor value: 5.181 | ISO 9001:2008 Certified Journal | Page 1160

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 04 Issue: 09 | Sep -2017 www.irjet.net p-ISSN: 2395-0072

databases and their consequent impact on the defined time is used to include temporal information most recent temporal extensions of SQL? which is not handled by transaction time or valid time; and values of user-defined time are not interpreted by a  How are the various database vendors adopting DBMS. temporal extensions of SQL to their database management system products? As an example, consider Mr. X who registers for his health insurance on 4th June, 1995. However, the health  Are there any shortcomings of the most recent insurance company could not record this information in SQL standard, SQL: 2011 and which further their computer system because of technical challenges. On research is being conducted to solve these 8th July, 1995, the company is able to record Mr. X’s problems? information in their database. In this case, 4th June, 1995 is the valid time start of his insurance and 8th July, By gathering and analyzing various literature, other 1995 becomes the transaction time. The need for sources of information and extensive research, we attempt temporal support in databases keeps increasing over the to understand the rationale behind the temporal concepts years: From the years 1982 to 1986, about 25 groups in SQL over the years. were also studying time in databases and 60 articles on temporal databases had been released [8]. It therefore 2. TEMPORAL DATABASES became necessary to develop a common consensus glossary on temporal database concepts: this goal was Conventional databases represent the state of information successfully achieved [9]. at a single point in time; new data can be added and modifications to existing data can be easily performed. Many years now, numerous temporal extensions have However, a drawback of these conventional databases been proposed and therefore there is the need to further was the fact that old values were usually lost whenever consolidate information. Unlike temporal databases, changes occurred and as such it was impossible to track conventional databases model the dynamic real world as the change of information over time in the database. Also, a snapshot at a particular point in time, and it may not in the early years, DBMSs provided very limited support reflect the status of the information in the real world. for handling attributes involving time; Application Therefore, as soon as an update is performed on such a programs had to implement functionalities for this database, the old information is lost and answering purpose. Keeping track of data over time was therefore a queries about past states became a major problem. These major problem which needed to be addressed in databases were referred to as snapshot databases [8]. To databases. make such databases up-to-date, DBMSs provide various mechanisms. One of those was to store all the past states Although the relational data model had gained popularity of the snapshot database and index them by the over the years, it provided very little support for they change (their transaction times). addressing the temporal dimension of data. The need to handle time more comprehensively arose in the early Although this method was a step forward, we could only 1970s especially in the area of medical information keep track of the transaction time history of the database systems, where a patient’s medical history is particularly without any support for history of the real world. Another important [6]. Other application areas which handle time approach to store past information is by using historical related information in databases include banking, databases. These databases record a single historical state inventory management and airline reservation systems. per relation, thereby taking into account the valid time Today, handling data that evolves over time can be [8]. In 1987, when Snodgrass introduced a new temporal effectively done using temporal databases. A temporal relational query language, TQuel [8], he also proposed DBMS therefore has built-in support for time-varying that the approaches to historical and rollback databases data. can be adopted in temporal databases which require support for both valid time and transaction time. In temporal databases, timestamps can be attached to data or information. To establish the lifetime of a piece of The effort of the database community to provide support information, we can represent its start time and end time for temporal data has really paid off. Today most DBMS in a database. The three notions of time which are vendors provide temporal support in their database relevant to temporal databases are user-defined time, products. Temporal databases can now be easily created valid time and transaction time. Valid and transaction to provide support for valid time, transaction time or times were coined by a very active researcher in the both. The widely used query language for relational database community called Richard Snodgrass, together databases, SQL, has also undergone major changes to with his doctoral student, Ahn [7]. Valid time refers to provide improved support for temporal data. when a fact is true in the real world. Transaction time is the time a fact is stored or modified in a database. User- © 2017, IRJET | Impact Factor value: 5.181 | ISO 9001:2008 Certified Journal | Page 1161

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 04 Issue: 09 | Sep -2017 www.irjet.net p-ISSN: 2395-0072

3. STRUCTURED QUERY LANGUAGE (SQL)

Structured Query Language (SQL) is the standard language used to retrieve information in relational databases. It was initially developed at IBM by Donald D. Chamberlin and Raymond F. Boyce in the early 1970s [6]. This initial version was referred to as Structured English Query Language, SEQUEL, and was designed purposely to manipulate data in IBM’s first relational DBMS prototypes referred to as System R [6]. Subsequently, SQL was later Figure 1: Timeline of history of temporal extensions of introduced as a commercial database system in 1979 by SQL Oracle Corporation. 4.1SQL-92 In 1986, ‘‘Database Language SQL’’ was formally adopted by the ANSI and ISO standards groups [10]. The official The first major revision on the standard since its name of SQL as specified by the ISO is ISO/IET 9075 introduction occurred in 1992 and it was called SQL2 It is Standard:”Information Technology- Database Languages- also known by names such as SQL/92, SQL-92, ISO/IEC SQL”. According to Donald Chamberlin [6], making SQL a 9075:1992, ANSI X3.135-1992, or FIPS 127-2 [11]. SQL-92 standard provided a mechanism for controlled evolution introduced significant features including some initial of the language and also created a forum for users and support for temporal data. Four data types were implementers to share ideas on the Language. From that introduced, three of which were used in order to represent time till today, the SQL standard has undergone major a point in time on the time axis referred to as an instant, revisions and new features have been introduced and the other used to represent of time. These (including e.g., outer joins, table expressions, recursion, three data types were: DATE (a particular day, with a year triggered actions, user-defined types and functions, and in the range ad 1–9999), TIME (a particular second within online analytic processing (OLAP) functions). One of the a range of 24 hours), and TIMESTAMP (a particular most important features of SQL is its improved support fraction of a second, defaulting to microsecond, of a for temporal data over the years. New versions of the SQL particular day) [12]. A DATE field consists of 10 characters standard were released in 1989, 1992, 1999, 2003, 2006, which are used to denote day, month and year. DATE 2008 and 2011. literals are specified in SQL by the keyword DATE, followed by a string of the form YYYY: MM: DD. In SQL, 4. TEMPORAL FEATURES OF SQL STANDARDS TIME is represented using the Universal Coordinated OVER THE YEARS Time. TIME values are represented by the keyword TIME, followed by specifying the hour, minutes and seconds in The SQL standard has undergone eight main revisions and the form, hh:mm:ss. TIME fields are usually 8 characters the latest version was released in 2011. Each standard long but it is possible to specify precisions higher than a came with its own set of features by correcting problems second: In this case, a dot is introduced after the default 8 in a previous standard and introducing entirely new character string and the number of digits after the dot features. However, not all the eight revised versions must be placed in parenthesis after the keyword TIME. provided temporal support for SQL. The SQL standard has been divided into multiple parts to enable the relevant TIMESTAMP data type contains year, month, day, pieces to progress at different rates. Parts have been hour, minute, and second values represented in the form rejoined and split over the years based on extensive YYYY-MM-DD hh:mm:ss. Just as in TIME data type, it is research and recommendations from the database possible to specify higher precisions by introducing community. Figure 1 depicts the timeline of events with fractions of a second. The fourth data type introduced was respect to incorporating temporal extensions into SQL. the INTERVAL. A time interval is a directed duration of time with a known length, but not specific starting or ending instants. If we wish to specify the duration between two instant time points, the term PERIOD is used. By the definitions of both INTERVAL and PERIOD, it is clear that they represent entirely two different things. SQL-92 supports two kinds of intervals, month-year and second-day intervals [12]. There are three variants of month-year intervals namely INTERVAL YEAR, INTERVAL MONTH and INTERVAL YEAR TO MONTH [13]. Second- day intervals can also be written in different forms such as

© 2017, IRJET | Impact Factor value: 5.181 | ISO 9001:2008 Certified Journal | Page 1162

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 04 Issue: 09 | Sep -2017 www.irjet.net p-ISSN: 2395-0072 e.g., INTERVAL DAY and INTERVAL DAY TO SECOND. More detailed support for temporal data, the database community made information about the description and use of intervals can attempts to introduce some parts of the TSQL2 into the be obtained from [13]. SQL:1999 standard. This new part (part 7) was called SQL/Temporal and it was to be included as a new 4.2TSQL2 substandard of SQL:1999. However, this attempt was unsuccessful because the TSQL2 approach was heavily Although SQL-92 introduced some form of temporal criticized by Chris Date and Hugh Darwen [18]. In their support, this was still not enough with respect to words, TSQL2 contained major “flaws” and one of the managing time in databases. The database community obvious ones was related to “hidden attributes” [18]. continued to work towards improving the old and Consequently SQL/Temporal was withdrawn and the ISO developing new mechanisms for temporal support in project for temporal support was eventually cancelled in databases. In 1994 [2], a temporal extension to SQL2 2001 because people were no longer willing to dedicate called TSQL2 was developed. TSQL2 is based on and highly more efforts to the topic [18]. compatible with SQL-92; legacy applications in the latter can easily be supported without any statement The fifth revision to the SQL standard occurred in 2003 modifications or introduction of additional codes. [19]. SQL:2003 made revisions to all parts of SQL:1999 and added a brand new part, Part 14: SQL/XML, XML- The language specification inherits the DATE, TIME, Related Specifications. New data types; BIGINT, TIMESTAMP and INTERVAL data types from SQL-92. A MULTISET, and XML were also introduced. [19] gives a new temporal data type PERIOD was also introduced, good overview of the features that were introduced in this making it easier to specify range and precision. Other standard. There was no temporal extension to SQL in this results from the TSQL2 project included the introduction Standard. SQL:2006 was introduced after SQL:2003 and of the three : user-defined, valid and transaction the major change that it contained was revision to Part 14, times, temporal aggregates and surrogate data. In SQL-92, SQL/XML, of the SQL:2003 standard. In July, 2008, only snapshot tables existed; TSQL2 provided more SQL:2008 was introduced but also did not offer any new support for introducing temporal elements into tables form of support for temporal databases. enabling users to include different timestamps into snapshot tables, event tables, valid time tables, transaction 4.4SQL:2011 time tables and bitemporal tables. Valid time and transaction time which represent the time a fact occurred About three years after SQL:2008, a new standard, in the real world and the time a fact was stored in a SQL:2011 was released [5]. This standard was to some database respectively. The document containing the extent based on some concepts from SQL/Temporal and TSQL2 Language specification can be obtained from [2]. provided extensive support for temporal data. Out of the This document contains about 71 pages of information on nine parts which existed in SQL:2008, five of them were the concepts, syntax and implementation of TSQL2. modified. The remaining four remained in effect. SQL:2011 provides substantive support for handling temporal 4.3SQL:1999 and SQL/Temporal information in databases. The new temporal features are now part of SQL:2011 Part 2, SQL/Foundation [20], The fourth revision of the SQL standard occurred in instead of appearing as a new part as was in the case of 1999; It was known as SQL3 or SQL:1999 [14]. An SQL/Temporal. New terminologies such as system- interesting change occurred in the naming convention of versioned tables, application time period tables and this standard. The hyphen which was used in the previous system-versioned application time period tables have standards such as SQL-89, SQL-92 was replaced with a been introduced for the old concepts which existed in colon in SQL:1999. This change was needed for two main TSQL2 namely transaction time tables, valid time tables reasons. The first was to ensure consistency with the and bitemporal tables respectively. names of other ISO standards [15]. Secondly, unlike the previous years where shortened form of the years, for e.g SQL:2011 is the most recent of the various SQL ‘86 and ‘92 were used, 1999 was maintained in full when standards. After the last major project, SQL/Temporal, the standard was named. This decision was taken because which was to add temporal extensions to SQL was of the year 2000 computer problem, Y2K [16] and the cancelled in 2001, it took about 10 years before new impact of dropping the century indicator from dates [17]. temporal extensions were added to SQL. In between the SQL:1999 consisted of eight different parts which were SQL/Temporal and SQL:2011, the SQL standard published in two groups [17]. Though SQL:1999 was a underwent three major revisions namely SQL:2003, significant improvement on the previous SQL standards, SQL:2006 and SQL:2008, but the revisions to the standard there were no new features introduced to improve did not include new features for handling temporal data handling temporal data. aside the pre-existing datatypes DATE, TIME, TIMESTAMP and INTERVAL. Consequently, it was challenging for users

© 2017, IRJET | Impact Factor value: 5.181 | ISO 9001:2008 Certified Journal | Page 1163

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 04 Issue: 09 | Sep -2017 www.irjet.net p-ISSN: 2395-0072 to represent the of time between two instants which represented in this new standard and are referred to as is denoted as period because no datatype existed in SQL system-versioned application-time period tables. Whereas which could serve that purpose. Users had to “define” new syntactic expressions have been introduced for periods in their databases by creating two table columns, queries in system-versioned tables and updates in for the start time and the end time. Many applications had application-time period tables, it is the opposite case for to implement basic temporal operations like by updates in system-versioned tables and queries in introducing extra codes in their software applications: this application-time period tables. Another important feature often led to development overhead, faulty semantics and which has been introduced is the possibility to specify sub-optimal performance [21]. primary key and unique constraints to ensure that no two rows with the same key value have overlapping periods. In December 2011, SQL:2011 [22] was formally adopted, replacing SQL:2008 as the most recent version of New period predicates have also been introduced in the standard. This new standard is also referred to as SQL:2011 which help to formulate queries for conditions ISO/IEC 9075:2011 ("Information technology – Database involving periods. These predicates are functionally languages – SQL") and the official document contains more similar to Allen operators but produce contrasting results than a thousand pages. One of the main new features of in many cases. Period predicates existed as far back as in this new standard is improved support for temporal SQL:92, which had the OVERLAPS predicate. Both TSQL2 databases [23]. A new set of language extensions for and SQL/Temporal also introduced the CONTAINS, temporal data support are now part of SQL:2011 Part 2, OVERLAPS, MEETS, PRECEDES and SUCCEEDS operators. SQL/Foundation instead of appearing as a new part [24]. The above mentioned predicates have made their way into Almost four years after the introduction of this standard, SQL:2011, along with other new period predicates. the amount of literature covering its temporal aspects is Notable among the new SQL period predicates are the quite limited. Several informative sources gathered during IMMEDIATELY PRECEDES and IMMEDIATELY SUCCEEDS our research include but are not limited to the following predicates. Considerable amount of success has been [23] [24] [25]. achieved in the area of temporal support for databases but a lot still needs to be done. Although the SQL standard has Temporal concepts in SQL:2011 are largely based on undergone major revisions since it was established in concepts and constructs from SQL/Temporal, but there 1989, only a few versions provide some support for are significant differences [23]. The PERIOD datatype temporal data. The need to provide temporal support in which was proposed in TSQL2 and SQL/Temporal did not database systems became a major concern after SQL-92 make it into SQL:2011. However, SQL:2011 provides a was released. Since then, the most recognized projects and means of specifying distance between two instants, which efforts towards temporal support in databases occurred is called a period. Perhaps among the reasons why there is during TSQL2, SQL/Temporal and finally in the most no period data type in SQL till today is because of the costs current standard SQL:2011. involved: For e.g, if a period datatype was added to SQL, then it would have to also be added to the stored 5.DBMSs’ SUPPORT FOR TEMPORAL DATA procedure language, to all database APIs such as JDBC, ODBC, and .NET, as well as to the surrounding In order to store, manipulate and query time related data technologies such as ETL products, replication solutions, in databases, the underlying database management system and others [22]. must provide built-in support for temporal extensions. Over the years, quite a number of attempts have been As a means of representing periods, SQL:2011 adds period made by the database community, including DBMS definitions as metadata to tables: A period definition is a vendors and SQL standard committees, to develop named table component which identifies a pair of columns temporal extensions to SQL. However, not much that capture the period start and the period end time. At information is available about the research and efforts of any point in time, these period definitions can be created the above mentioned groups between the years 2002 and or removed using enhanced CREATE and ALTER table 2011 after the SQL/Temporal project was cancelled. statements present in this new standard [23]. SQL: 2011 Nonetheless, some indications make it obvious that efforts represents time periods using the closed-open model and were actually made; For e.g., DBMS vendors began ensures that the start time is always less than the end adopting temporal features in their DBMS products, and time. This constraint is enforced as soon as the keyword also concepts proposed by researchers have been PERIOD is declared in a table definition. incorporated in the new standard, SQL:2011, to provide improved temporal support. The historical and current SQL:2011 introduces new terminology for some pre- state of temporal support in DBMSs and the contribution existing time dimensions from TSQL2 and SQL/Temporal: of some major DBMS vendors towards the current state of Valid time tables are referred to as application-time period temporal support in databases cannot be overemphasized. tables and transaction time tables are now called system- versioned tables [23]. Bitemporal tables can also be © 2017, IRJET | Impact Factor value: 5.181 | ISO 9001:2008 Certified Journal | Page 1164

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 04 Issue: 09 | Sep -2017 www.irjet.net p-ISSN: 2395-0072

One of the legacy systems which provided some form of end time periods, and a PERIOD BUSINESS TIME clause temporal support was the Oracle 9i, a database [30]; This is similar to how application time period tables management system developed by the Oracle Corporation are specified in SQL:2011. Bitemporal tables in IBM DB2 in 2002. This database system had the Flashback [26] 10.5 includes specifying columns for both and feature which permits users to query data as it existed in a business time; the same concept in SQL:2011. previous state. Oracle 9i has a special utility package, DBMS_Flashback to handle flashback queries. To activate In Teradata, the temporal features are based on the TSQL2 the flashback feature, users first have to reconfigure their specification [31]. Temporal query processing in Teradata databases to grant the appropriate privileges. After which is implemented by using functional query rewrites or by the user has to decide on one of two approaches which can implementing a native temporal support in the underlying be used to implement flashback queries [27]. The first database engine. The latter approach processes temporal approach is a time based approach, where users have to queries by compiling and rewriting them into generic, explicitly specify time values from past time. The other non-temporal operations [31]. Although some members of approach is to use a SYSTEM CHANGE NUMBER to identify the Teradata Company state that the rewrite approach is the point to go back to [27]. Each of these approaches generally simpler to implement, they also admit that it employs the “AS OF” clause. For example, the conventional adds a structural complexity to the original query, which SQL SELECT statement is modified as: Select * from can pose a potential challenge to query optimization [31]. employee AS OF TIMESTAMP or The other way to implement temporal queries in Teradata Select * from employee AS OF SCN [28]. Oracle has maintained this query feature over scans, projections and joins directly in the DBMS internals the years and its DBMS system, Oracle 12c still supports [31]. flashback [29]. The concepts valid time and transaction time are also Other major DBMS vendors which have provided “employed” by Teradata. Teradata also supports substantive support for temporal data include IBM and bitemporal tables, but at most one system time and at Teradata. IBM DB2 database management systems most one application time is allowed per table [31] as implement almost all the temporal features in SQL:2011 opposed to the specification in SQL:2011, where two using slightly different syntax and terminology [30]. values represent the application time. Temporal data Business time, system time and bitemporal tables in IBM types supported in Teradata include the “usual” DATE, DB2 are named as application time period tables, system TIME, TIMESTAMP and INTERVAL as well as the “much versioned tables and system versioned application time anticipated” PERIOD datatype. Teradata supports the period tables respectively in SQL:2011 [30]. Slight PERIOD data type since V13.0; a PERIOD column can be differences exist between the SQL:2011 specification and any date or timestamp type although the beginning and the implementation of the temporal features in IBM DB2. end must have the same type, and the format of the date or In IBM DB2 version 10.5’s implementation of temporal timestamp also needs to be specified in the create table concepts, a user does not have the possibility to define statements. The PERIOD data type uses the closed/open their own names for periods when creating business time concept, where the start of the period is included but the tables: it is predefined as BUSINESS_TIME. This end is excluded. Perhaps Teradata is a “step ahead” with implementation contrast with the convention for naming regards to introducing the period data type, which still application time period tables in SQL:2011, where period does not exist in SQL:2011. In table 1, we present an names in create table statements are user-defined. overview of the current state of temporal support for databases by three of the leading DBMS vendors. Also, the syntax for creating system time tables in IBM DB2 10.5 differs from system versioned tables in Aside implementing their own temporal features, it is also SQL:2011. In the former, three timestamped columns are known [30] that some of these DBMS vendors such as IBM, used to store system time values: two timestamped worked with the ANSI and ISO SQL standard committees columns store information about the start and end points to incorporate the new temporal extensions into the latest of the system time and one column stores information SQL:2011 standard. It is interesting to note that, IBM DB2 about transaction start time [30]. The transaction start was the first database vendor, which fully supported the time column tracks when a transaction first executes a temporal features of SQL:2011. Defining and using tables statement which changes the table's data. Users are in Teradata follows the TSQL2 specification, thereby permitted to either manually enter or instruct the system raising the problem of incompatibility with SQL:2011 [21]. to automatically generate the values for the three timestamped columns mentioned above. In the latter instance, the keyword GENERATED ALWAYS is used; This keyword also exists in SQL:2011 and serves the same purpose. To create business time tables in IBM DB2 10.5, one has to include two columns to represent the start and © 2017, IRJET | Impact Factor value: 5.181 | ISO 9001:2008 Certified Journal | Page 1165

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 04 Issue: 09 | Sep -2017 www.irjet.net p-ISSN: 2395-0072

Table -1: Current state of temporal support provided the syntax for creating, storing and manipulating data in by DBMS vendors the respective tables. Looking at the diagram, it is observable that the newer projects improve on the DBMSs concepts from the preceding ones by either changing syntax or introducing new concepts. Temporal IBM DB2 Oracle Teradata concepts in Temporal extensions of SQL have been developed and SQL improved over the years and the level of difficulty associated with managing data related to time in DATE, TIME, databases is on a lower level now. In spite of this TIMESTAMP achievement, there is still more which can be done, data types    especially in the area of surveying new forms of temporal support for databases and working towards the inclusion INTERVAL of new temporal extensions in the subsequent SQL data type    standards to be developed.

PERIOD data One major “problem” which has still not been addressed is type x x  the absence of a PERIOD data type in SQL. Proposals for PERIOD data type could not go beyond the TSQL2, System ST table TT table (1 TT table (1 SQL/Temporal . Since SQL:2011 did not support this versioned (3 columns column for column for data type, it remains unclear what the future holds with tables for ST) TT) TT) respect to it. Many people anticipate that the introduction of PERIOD data type into SQL will be costly because a lot of Application BT (2 VT table (2 VT (1 the technologies which “work” with SQL would have to be time period columns for columns for column for modified to adapt to this data type [23]. As at the time of tables BT ) VT) VT) our research, we found virtually no information about when a new SQL standard will be released and whether or System Bitemporal Bitemporal Bitemporal not it will include support released and whether or not it versioned (5 columns (3 columns (2 columns will include support for the PERIOD data type. Aside the application for both ST for both VT for both VT PERIOD data type, there are other features which are still time period and BT) and ST) and ST) not supported in SQL and perhaps some of these features tables may be introduced in the next standard. These features include but are not limited to: support for multiple application time periods per table and improved support ST –System time BT- Business time for period joins [23]. A period join is performed by joining TT- Transaction Time VT – Valid Time a row from one table with a row from another table such  - available X - unavailable that their application time or system time periods satisfy a

condition such as overlap. Using the OVERLAPS operator 6. CONCLUSION in SQL:2011, inner joins can be performed but additional support is still needed in order to perform outer joins [23].

Another feature which could also be introduced is SQL support for temporal features in databases has coalescing, to bring together tuples which have identical undergone reformation over the years. Some of the attribute values and with timestamps, which are adjacent features had to be dropped while others are still available in time or share some time periods in common [27]. in the current SQL standard. In figure 2, we look at the trend of developments with regards to some temporal Introducing temporal extensions into SQL has been support introduced in the various SQL standards and beneficial to DBMS vendors and application developers. projects over the years. The figure does not cover all the DBMS vendors have and are still making efforts to adapt temporal concepts in the various projects but just a few of their systems to support temporal data. Temporal support the major ones. It can be observed from the figure that the by DBMSs ensures consistent handling of time-related data types INTERVAL and PERIOD have been dropped in events and reducing query complexity in temporal the most recent version of SQL, SQL:2011. Also, the main databases. A study presented in [21], evaluated the idea behind the concepts “valid time”, “transaction time” performance of DBMS products with respect to their and “bitemporal” have been maintained over the years; architectural support for temporal databases and However, each of the standards and projects shown in the performance when executing temporal queries. The diagram referred to the concepts by different names. The results showed that the support for temporal data is still difference between the representations of the concepts in in its infancy as all the DBMS they considered store their various standards does not only lie in the naming, but also data in regular, statically partitioned tables and rely on © 2017, IRJET | Impact Factor value: 5.181 | ISO 9001:2008 Certified Journal | Page 1166

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 04 Issue: 09 | Sep -2017 www.irjet.net p-ISSN: 2395-0072 standard indexes as well as query rewrites for their REFERENCES operations, leading to performance overheads [21]. [1]Snodgrass, Richard. "TSQL: A Design Approach." White As the SQL standard is revised over the years, it is likely paper, University of Arizona, Department of Computer that we will observe a continued improved support for Science, Tucson ,1992 handling temporal data in databases. The field of temporal database research is still active and there even exists an [2]Snodgrass, Richard Thomas, et al. "TSQL2 language international center, the TimeCenter, which supports specification." Sigmod Record 23.1, 1994, pp 65-86 temporal database applications on traditional and emerging DBMS technologies [27]. [3]Eisenberg A.; Melton J., SQL: 1999, formerly known as SQL3, ACM SIGMOD Record Volume 28 Issue 1, March Some members of this Center include very renowned 1999, New York, USA, pp 131 – 138 people who have made significant contributions to the field of temporal databases. Temporal database research [4]Snodgrass, R et al., "Transitioning temporal support in has surely paid off and although we are not certain of the TSQL2 to SQL3." Temporal Databases: Research and timing, the database community still awaits the Practice, Springer Berlin Heidelberg, 1998, pp 150- development of next SQL standard after SQL:2011, with 194 the hope that it will provide improved support for temporal databases. [5]Zemke, Fred. "What’s new in SQL: 2011." ACM SIGMOD Record 41.1 ,2012, pp 67-73 [6]Chamberlin, Donald D; Boyce, Raymond F."SEQUEL: A Structured English Query Language" (PDF). Proceedings of the 1974 ACM SIGFIDET Workshop on Data Description, Access and Control (Association for Computing Machinery), 1974 pp 249–264

[7]Snodgrass Richard T. and Ilsoo A, "Temporal Databases," IEEE Computer 19(9), September, 1986, pp. 35–42 [8]Snodgrass, R. "The temporal query language TQuel." ACM Transactions on Database Systems (TODS) 12, no. 2,1987, pp 247-298 [9]Dyreson, C., Fabio G,, Wolfgang K., Nick K., Nikos L., Yannis M., Angelo M. et al. "A consensus glossary of temporal database concepts." ACM SIGMOD Record 23, no. 1, 1994, pp 52-64

[10]Chamberlin, Donald D. "Early history of SQL." Annals of the History of Computing, IEEE 34, no. 4 , 2012, pp 78-82

[11]“The SQL-92 Standard”, Second Informal Review Draft, ISO/IEC 9075:1992, Database Language SQL, Digital Equipment Corporation, Maynard, Massachusetts, July 30, 1992

[12]Snodgrass, Richard T. "Temporal databases", In IEEE computer, 1986

[13]Representing time in SQL, Temporal Information Systems lecture notes by Prof. Dr. Rainer Manthey, Department of Computer Science, University of Bonn, Figure 2: Some temporal features of the various SQL Germany, Summer semester 2014 standards and projects. Abbreviations: PP- period [14]ANSI/ISO/IEC International Standard (ISO/IEC 9075- predicates, BT - bitemporal table, TT - transaction time 2:1999) Database Language SQL — Part 2: Foundation VT – Valid time (SQL/Foundation), Part 2, September 1999

© 2017, IRJET | Impact Factor value: 5.181 | ISO 9001:2008 Certified Journal | Page 1167

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 04 Issue: 09 | Sep -2017 www.irjet.net p-ISSN: 2395-0072

[15]Van Der L., Rick F., SQL for MySQL Developers: a [30]Saracco, Cynthia M., Nicola, M. and Ghandi, L. , A comprehensive tutorial and reference, Pearson matter of time: Temporal data management in DB2 10, Education, 2007 IBM, April 3, 2012

[16]Y2K bug. Encyclopædia Britannica Online [31]Al-Kateb, Mohammed, et al., Temporal query processing in Teradata, EDBT '13: Proceedings of the [17]Melton, J, Alan R. S., SQL: 1999: Understanding 16th International Conference on Extending Database relational language components, Morgan Kaufmann, Technology, ACM, March 2013, pp 573-578 2001

[18]Darwen, H, Date C.J. "An Overview and Analysis of Proposals Based on the TSQL2 Approach.", 2005

[19]Eisenberg, A., Jim M., Krishna K., Jan-Eike M., and Fred Z. "SQL: 2003 has been published." ACM SIGMOD Record 33, no. 1 ,2004, pp 119-126

[20]ISO/IEC 9075-2:2011, Information technology— Database languages SQL Part 2: Foundation (SQL/Foundation), 2011

[21]Kaufmann, Martin, et al .,Benchmarking Bitemporal Database Systems: Ready for the future or stuck in the past, Proc. of the 17th International Conference on Extending Database Technology (EDBT), March 24-28 2014, Athens, Greece

[22]SQL:2011, International Organization for Standardization (ISO) webshop http://www.iso.org/iso/iso_catalogue/catalogue_tc/c atalogue_detail.htm?csnumber=53681

[23]Kulkarni, K. and Michels, Jan-E.. , Temporal features in SQL:2011, ACM SIGMOD Record, 2012, Vols. 41.3, pp 34-43

[24]ISO/IEC 9075-2:2011, Information Technology- Database languages-SQL-Part 2. Foundation (SQL/Foundation), 2011 as cited in Kulkarni K., Michels J.E, Temporal features in SQL:2011, ACM SIGMOD Record, 41.3, 2012 [25]Baumunk, C., “Bitemporaldata.com: An overview of temporal features in SQL:2011”, Slides on temporal features of SQL:2011, May 22, 2015

[26]Adrian Billington ,Flashback query in oracle 9i, Oracle Developer.net, November 2002,

[27]Petković, D., Temporal Data in Enterprise Database Systems, The 7th International Conference on Information Technology, 2015, pp 276-282

[28]Irfan Haq, Recovery made simple, Oracle Flashback Query ,Oracle FAQ online, October 2004

[29]Using Oracle Flashback Technology, Database development , Online Documentation 12c Release 1 (12.1) / Database Administration

© 2017, IRJET | Impact Factor value: 5.181 | ISO 9001:2008 Certified Journal | Page 1168