SQL:2011

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

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.[1]

Parts

The standard is split into these parts:[2]

  • Part 1: Framework (SQL/Framework)
  • Part 2: Foundation (SQL/Foundation)
  • Part 3: Call-Level Interface (SQL/CLI)
  • Part 4: Persistent Stored Modules (SQL/PSM)
  • Part 9: Management of External Data (SQL/MED)
  • Part 10: Object Language Bindings (SQL/OLB)
  • Part 11: Information and Definition Schemas (SQL/Schemata)
  • Part 13: SQL Routines and Types Using the Java™ Programming Language (SQL/JRT)
  • Part 14: XML-Related Specifications (SQL/XML)

New features

Temporal support

One of the main new features is improved support for temporal databases.[3][4] 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-open 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 PERIOD FOR 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 WITHOUT OVERLAPS 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 CONTAINS, OVERLAPS, EQUALS, PRECEDES, SUCCEEDS, IMMEDIATELY PRECEDES, and IMMEDIATELY SUCCEEDS (which are modified versions of Allen’s interval relations)
  • Definition of system-versioned tables (elsewhere called transaction time tables), using the PERIOD FOR SYSTEM_TIME annotation and WITH SYSTEM VERSIONING 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 AS OF SYSTEM TIME and VERSIONS BETWEEN SYSTEM TIME ... AND ... clauses
  • Application time and system versioning can be used together to provide bitemporal tables

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".,[5][6] although they use the alternative syntax FOR SYSTEM_TIME AS OF.

Oracle Oracle 12c supports temporal functionality in compliance with SQL:2011.[7] Versions 10g and 11g implement the time-sliced queries in what they call Flashback Queries, using the alternative syntax AS OF TIMESTAMP.[8] Notably both of Oracle's implementations depend on the database transaction log 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 SYSTEM_VERSIONING.[9]

See also

References

External links

  • Lua error in package.lua at line 80: module 'strict' not found..
  • Lua error in package.lua at line 80: module 'strict' not found..
  • Lua error in package.lua at line 80: module 'strict' not found..
  • Lua error in package.lua at line 80: module 'strict' not found..
  • Lua error in package.lua at line 80: module 'strict' not found..