SQL:2011

2011 edition of the SQL standard


title: "SQL:2011" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["sql", "declarative-programming-languages", "query-languages", "programming-languages-created-in-2011"] description: "2011 edition of the SQL standard" topic_path: "technology/databases" source: "https://en.wikipedia.org/wiki/SQL:2011" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::summary 2011 edition of the SQL standard ::

SQL:2011 or ISO/IEC 9075:2011 (under the general title "Information technology – Database languages – SQL") is the seventh revision of the ISO (1987) and ANSI (1986) standard for the SQL database query language. It was formally adopted in December 2011. The standard consists of 9 parts which are described in detail in SQL. The next version is SQL:2016.

New features

One of the main new features is improved support for temporal databases. Language enhancements for temporal data definition and manipulation include:

  • Time period definitions use two standard table columns as the start and end of a named time period, with closed set-open set semantics. This provides compatibility with existing data models, application code, and tools
  • Definition of application time period tables (elsewhere called valid time tables), using the annotation
  • Update and deletion of application time rows with automatic time period splitting
  • Temporal primary keys incorporating application time periods with optional non-overlapping constraints via the clause
  • Temporal referential integrity constraints for application time tables
  • Application time tables are queried using regular query syntax or using new temporal predicates for time periods including , , , , , and (which are modified versions of Allen’s interval relations)
  • Definition of system-versioned tables (elsewhere called transaction time tables), using the annotation and modifier. System time periods are maintained automatically. Constraints for system-versioned tables are not required to be temporal and are only enforced on current rows
  • Syntax for time-sliced and sequenced queries on system time tables via the and clauses
  • Application time and system versioning can be used together to provide bitemporal tables

Support in database management systems

SAP HANA 2.0 SP03 supports system-versioned tables using the standard select syntax SAP HANA 2.0 SP04 adds (partial) support for application-time versioning

IBM DB2 version 10 claims to be the first database to have a conforming implementation of this feature in what they call "Time Travel Queries", although they use the alternative syntax .

Oracle 12c supports temporal functionality in compliance with SQL:2011. Versions 9, 10g and 11g implement the time-sliced queries in what they call Flashback Queries, using the alternative syntax . Notably both of Oracle's implementations depend on the database's rollback segment and so only allow temporal queries against recent changes which are still being retained for backup.

Microsoft SQL Server (version 2016) implements temporal tables with .

MariaDB 10.3 implements system-versioned tables. MariaDB 10.4.3 added support for application-versioned tables.

PostgreSQL requires installation of the temporal_tables extension. Temporal Tables Extension supports the system-period temporal tables only, but does not follow the SQL:2011 design.

Ebean ORM supports History AS OF and VERSIONS BETWEEN queries on PostgreSQL and MySQL using triggers, history tables and views.

CockroachDB has supported queries since at least v1.0.7.

References

References

  1. Paulley. (December 16, 2011). "IA". Sybase.
  2. Zemke, Fred. "[http://www.sigmod.org/publications/sigmod-record/1203/pdfs/10.industry.zemke.pdf What's new in SQL:2011] {{Webarchive. link. (2013-08-10 ". ACM SIGMOD Record 41.1 (2012): 67-73)
  3. Kulkarni, Krishna, and Jan-Eike Michels. "[http://www.sigmod.org/publications/sigmod-record/1209/pdfs/07.industry.kulkarni.pdf Temporal features in SQL: 2011] {{Webarchive. link. (2012-11-15 ". ACM SIGMOD Record 41.3 (2012): 34-43)
  4. "SAP Help Portal".
  5. "SAP Help Portal".
  6. "SAP Help Portal".
  7. "Data management".
  8. "Data management".
  9. "Implementing Temporal Validity".
  10. "flashback query in oracle 9i".
  11. "Flashback Query".
  12. "Database SQL Reference".
  13. (16 October 2023). "Temporal Tables - SQL Server".
  14. "Changes & Improvements in MariaDB 10.3".
  15. "Application-Time Periods".
  16. "AS OF SYSTEM TIME | CockroachDB Docs".
  17. (22 June 2016). "Time-Travel Queries: SELECT witty_subtitle FROM THE FUTURE". Cockroach Labs.

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

sqldeclarative-programming-languagesquery-languagesprogramming-languages-created-in-2011