Developing Time-Oriented Database Applications in SQL

The case studies in this book have amply demonstrated that SQL-92 does not look favorably upon time-oriented applications. Even the most simple tasks, such as specifying a primary key or joining two tables, become mired in complexity when time is introduced.
Fortunately, the clouds part at the horizon. A minor language extension proposed for SQL3 dramatically simplifies coding such applications by providing support for periods, valid time, and transaction time. In this chapter we rephrase the applications of previous chapters using these new constructs. That all can be reimplemented in a single chapter is an indication of the reduction in code length and complexity occasioned by these new constructs.
Finally, we examine some public domain and commercial tools that ease the transition until temporal support is directly incorporated into database systems.
The case studies have shown that expressing integrity constraints, queries, and modifications on time-varying data in SQL is challenging. We now look to the future, examining enhancements to SQL that bring temporal processing to the masses. With just a few additional concepts, SQL can as easily express temporal queries as it does now for nontemporal queries.
Many knotty problems arise when we have to contend with time-varying data in SQL-92.
Avoiding duplicates in a time-varying table requires an aggregate (CF-5.14) or a complex trigger (e.g., CF-5.26).
A simple 3-line join when applied to time-varying tables explodes to a 29-line query consisting of four SELECT statements (CF-6.11) or a complex 23-line statement with four CASE expressions (CF-6.12).