Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
SQL
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Interoperability and standardization== {{SQL language revisions}} ===Overview=== SQL implementations are incompatible between vendors and do not necessarily completely follow standards. In particular, date and time syntax, string concatenation, <code>NULL</code>s, and comparison [[case sensitivity]] vary from vendor to vendor. [[PostgreSQL]]<ref name="About PostgreSQL" /> and [[Mimer SQL]]<ref name="Mimer SQL, Built on Standards" /> strive for standards compliance, though PostgreSQL does not adhere to the standard in all cases. For example, the folding of unquoted names to lower case in PostgreSQL is incompatible with the SQL standard,<ref>{{cite web|url=https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS|title=4.1. Lexical Structure|date=2018|website=PostgreSQL documentation|access-date=11 December 2018|archive-date=5 October 2018|archive-url=https://web.archive.org/web/20181005190818/https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS|url-status=live}}</ref> which says that unquoted names should be folded to upper case.<ref>{{cite web|url=http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt|title=(Second Informal Review Draft) ISO/IEC 9075:1992, Database Language SQL, Section 5.2, syntax rule 11|date=30 July 1992|access-date=8 October 2009|archive-date=21 June 2006|archive-url=https://web.archive.org/web/20060621035823/http://www.contrib.andrew.cmu.edu/%7Eshadow/sql/sql1992.txt|url-status=live}}</ref> Thus, according to the standard, <code>Foo</code> should be equivalent to <code>FOO</code>, not <code>foo</code>. Popular implementations of SQL commonly omit support for basic features of Standard SQL, such as the <code>DATE</code> or <code>TIME</code> data types. The most obvious such examples, and incidentally the most popular commercial and proprietary SQL DBMSs, are Oracle (whose <code>DATE</code> behaves as <code>DATETIME</code>,<ref name="Ora DATE" /><ref name="Ora DATETIME" /> and lacks a <code>TIME</code> type)<ref name="Ora TIME" /> and MS SQL Server (before the 2008 version). As a result, SQL code can rarely be ported between database systems without modifications. ===Reasons for incompatibility=== Several reasons for the lack of portability between database systems include: * The complexity and size of the SQL standard means that most implementers do not support the entire standard. * The SQL standard does not specify the database behavior in some important areas (e.g., [[index (database)|indices]], file storage), leaving implementations to decide how to behave. * The SQL standard defers some decisions to individual implementations, such as how to name a results column that was not named explicitly.<ref name="professionals">{{cite book |last1=Date |first1=Chris J. |title=Relational Theory for Computer Professionals: What Relational Databases are Really All About |date=2013 |publisher=O'Reilly Media |location=Sebastopol, Calif |isbn=978-1-449-36943-9 |edition=1.}}</ref>{{rp|207}} * The SQL standard precisely specifies the syntax that a conforming database system must implement. However, the standard's specification of the semantics of language constructs is less well-defined, leading to ambiguity. * Many database vendors have large existing customer bases; where the newer version of the SQL standard conflicts with the prior behavior of the vendor's database, the vendor may be unwilling to break [[backward compatibility]]. * Little commercial incentive exists for vendors to make changing database suppliers easier (see [[vendor lock-in]]). * Users evaluating database software tend to place other factors such as performance higher in their priorities than standards conformance. ===Standardization history=== SQL was adopted as a standard by the ANSI in 1986 as SQL-86<ref name="X3H2" /> and the ISO in 1987.<ref name="ISO 9075:1987" /> It is maintained by [[ISO/IEC JTC 1/SC 32|''ISO/IEC JTC 1, Information technology, Subcommittee SC 32, Data management and interchange'']]. Until 1996, the [[National Institute of Standards and Technology]] (NIST) data-management standards program certified SQL DBMS compliance with the SQL standard. Vendors now self-certify the compliance of their products.<ref name="Doll" /> The original standard declared that the official pronunciation for "SQL" was an [[initialism]]: {{IPAc-en|Λ|Ι|s|Λ|k|juΛ|Λ|Ι|l}} ("ess cue el").<ref name="SQL-Fundamentals" /> Regardless, many English-speaking database professionals (including Donald Chamberlin himself<ref name="Gillespie" />) use the [[acronym]]-like pronunciation of {{IPAc-en|Λ|s|iΛ|k|w|Ιl}} ("sequel"),<ref name="Melton" /> mirroring the language's prerelease development name, "SEQUEL".<ref name=chamberlin-boyce-sequel /><ref name=oppel-databases /><ref name="Gillespie" /><br> The SQL standard has gone through a number of revisions: {| class="wikitable" style="margin-left: 1.5em;" |+Timeline of SQL language |- ! Year ! Official standard ! Informal<br />name ! Comments |- | 1986<br />1987 | ANSI X3.135:1986<br />[[ISO/IEC 9075]]:1987<br />FIPS PUB 127 | [[SQL-86]]<br />SQL-87 | First formalized by ANSI, adopted as [[Federal Information Processing Standard|FIPS]] PUB 127 |- | 1989 | ANSI X3.135-1989<br />ISO/IEC 9075:1989<br />FIPS PUB 127-1 | [[SQL-89]] | Minor revision that added integrity constraints, adopted as FIPS PUB 127-1 |- | 1992 | | ANSI X3.135-1992<br />ISO/IEC 9075:1992<br />FIPS PUB 127-2 | [[SQL-92]]<br />SQL2 | Major revision (ISO 9075), ''Entry Level'' SQL-92, adopted as FIPS PUB 127-2 |- | 1999 | ISO/IEC 9075:1999 | [[SQL:1999]]<br />SQL3 | Added regular expression matching, [[hierarchical and recursive queries in SQL|recursive queries]] (e.g., [[transitive closure]]), [[Database trigger|triggers]], support for procedural and control-of-flow statements, nonscalar types (arrays), and some object-oriented features (e.g., [[structured type]]s), support for embedding SQL in Java ([[SQL/OLB]]) and vice versa ([[SQL/JRT]]) |- | 2003 | ISO/IEC 9075:2003 | [[SQL:2003]] | Introduced [[XML]]-related features ([[SQL/XML]]), [[SQL window function|window functions]], standardized sequences, and columns with autogenerated values (including identity columns) |- | 2006 | {{nowrap|ISO/IEC 9075-14:2006}} | [[SQL:2006]] | Adds Part 14, defines ways that SQL can be used with XML. It defines ways of importing and storing XML data in an SQL database, manipulating it within the database, and publishing both XML and conventional SQL data in XML form. In addition, it lets applications integrate queries into their SQL code with [[XQuery]], the XML Query Language published by the World Wide Web Consortium ([[W3C]]), to concurrently access ordinary SQL-data and XML documents.<ref name="SQLXML2006" /> |- | 2008 | ISO/IEC 9075:2008 | [[SQL:2008]] | Legalizes ORDER BY outside cursor definitions. Adds INSTEAD OF triggers, TRUNCATE statement,<ref name="iablog.sybase.com-paulley" /> FETCH clause |- | 2011 | ISO/IEC 9075:2011 | [[SQL:2011]] | Adds temporal data (PERIOD FOR)<ref name="feature_temporal"/> (more information at [[Temporal database#History]]). Enhancements for [[SQL window function|window functions]] and FETCH clause.<ref name="features_2011"/> |- | 2016 | ISO/IEC 9075:2016 | [[SQL:2016]] | Adds row pattern matching, polymorphic table functions, operations on [[JSON]] data stored in character string fields |- | 2019 | ISO/IEC 9075-15:2019 | [[SQL:2019]] | Adds Part 15, multidimensional arrays (MDarray type and operators) |- | 2023 | ISO/IEC 9075:2023 | [[SQL:2023]] | Adds data type JSON (SQL/Foundation); Adds Part 16, Property Graph Queries (SQL/PGQ) |} ===Current standard=== The standard is commonly denoted by the pattern: ''ISO/IEC 9075-n:yyyy Part n: title'', or, as a shortcut, ''[[ISO/IEC 9075]]''. Interested parties may purchase the standards documents from ISO,<ref name="ISO/IEC 9075">{{cite web | url = https://www.iso.org/search.html | title = ISO/IEC 9075 | access-date = 9 August 2022 | archive-date = 12 August 2022 | archive-url = https://web.archive.org/web/20220812025804/https://www.iso.org/search.html | url-status = live }}</ref> IEC, or ANSI. Some old drafts are freely available.<ref name="Andrew" /><ref name="Whitemarsh2" /> ''[[ISO/IEC 9075]]'' is complemented by ''ISO/IEC 13249: SQL Multimedia and Application Packages'' and some ''Technical reports''.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)