https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=SQL_syntaxSQL syntax - Revision history2025-06-01T07:20:42ZRevision history for this page on the wikiMediaWiki 1.45.0-wmf.3https://en.wikipedia.org/w/index.php?title=SQL_syntax&diff=1292033254&oldid=prevOAbot: Open access bot: url-access updated in citation with #oabot.2025-05-24T20:43:20Z<p><a href="/wiki/Wikipedia:OABOT" class="mw-redirect" title="Wikipedia:OABOT">Open access bot</a>: url-access updated in citation with #oabot.</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 20:43, 24 May 2025</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 406:</td>
<td colspan="2" class="diff-lineno">Line 406:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>There are however disputes about the semantic interpretation of Nulls in SQL because of its treatment outside direct comparisons. As seen in the table above, direct equality comparisons between two NULLs in SQL (e.g. {{code|NULL {{=}} NULL}}) return a truth value of Unknown. This is in line with the interpretation that Null does not have a value (and is not a member of any data domain) but is rather a placeholder or "mark" for missing information. However, the principle that two Nulls aren't equal to each other is effectively violated in the SQL specification for the {{code|UNION}} and {{code|INTERSECT}} operators, which do identify nulls with each other.<ref name="Meyden">[https://books.google.com/books?id=gF0b85IuqQwC&pg=PA344 Ron van der Meyden, "Logical approaches to incomplete information: a survey" in Chomicki, Jan; Saake, Gunter (Eds.) ''Logics for Databases and Information Systems'', Kluwer Academic Publishers] {{ISBN|978-0-7923-8129-7}}, p. 344</ref> Consequently, these [[Set operations (SQL)|set operations in SQL]] may produce results not representing sure information, unlike operations involving explicit comparisons with NULL (e.g. those in a {{code|WHERE}} clause discussed above). In Codd's 1979 proposal (which was basically adopted by SQL92) this semantic inconsistency is rationalized by arguing that removal of duplicates in set operations happens "at a lower level of detail than equality testing in the evaluation of retrieval operations".<ref name="Klein" /> However, computer-science professor Ron van der Meyden concluded that "The inconsistencies in the SQL standard mean that it is not possible to ascribe any intuitive logical semantics to the treatment of nulls in SQL."<ref name="Meyden" /></div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>There are however disputes about the semantic interpretation of Nulls in SQL because of its treatment outside direct comparisons. As seen in the table above, direct equality comparisons between two NULLs in SQL (e.g. {{code|NULL {{=}} NULL}}) return a truth value of Unknown. This is in line with the interpretation that Null does not have a value (and is not a member of any data domain) but is rather a placeholder or "mark" for missing information. However, the principle that two Nulls aren't equal to each other is effectively violated in the SQL specification for the {{code|UNION}} and {{code|INTERSECT}} operators, which do identify nulls with each other.<ref name="Meyden">[https://books.google.com/books?id=gF0b85IuqQwC&pg=PA344 Ron van der Meyden, "Logical approaches to incomplete information: a survey" in Chomicki, Jan; Saake, Gunter (Eds.) ''Logics for Databases and Information Systems'', Kluwer Academic Publishers] {{ISBN|978-0-7923-8129-7}}, p. 344</ref> Consequently, these [[Set operations (SQL)|set operations in SQL]] may produce results not representing sure information, unlike operations involving explicit comparisons with NULL (e.g. those in a {{code|WHERE}} clause discussed above). In Codd's 1979 proposal (which was basically adopted by SQL92) this semantic inconsistency is rationalized by arguing that removal of duplicates in set operations happens "at a lower level of detail than equality testing in the evaluation of retrieval operations".<ref name="Klein" /> However, computer-science professor Ron van der Meyden concluded that "The inconsistencies in the SQL standard mean that it is not possible to ascribe any intuitive logical semantics to the treatment of nulls in SQL."<ref name="Meyden" /></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Additionally, because SQL operators return Unknown when comparing anything with Null directly, SQL provides two Null-specific comparison predicates: {{code|IS NULL}} and {{code|IS NOT NULL}} test whether data is or is not Null.<ref name="SQL2003-Part2-Sec87">{{cite book | last = ISO/IEC | title = ISO/IEC 9075-2:2003, "SQL/Foundation" | publisher = ISO/IEC }}</ref> SQL does not explicitly support [[universal quantification]], and must work it out as a negated [[existential quantification]].<ref name="Negri">{{cite journal|title=Semantics and problems of universal quantification in SQL |doi=10.1093/comjnl/32.1.90 |journal=The Computer Journal |date= February 1989|volume=32 |issue=1 |pages=90–91 |last1=Negri |first1=M. |last2=Pelagatti |first2=G. |last3=Sbattella |first3=L. |doi-access=free }}</ref><ref name="Fratarcangeli">{{cite journal|url=https://dl.acm.org/doi/10.1145/126482.126484 |title=Technique for universal quantification in SQL |doi=10.1145/126482.126484 |journal=ACM SIGMOD Record |year = 1991|access-date=2024-11-07|last1 = Fratarcangeli|first1 = Claudio|volume = 20|issue = 3|pages = 16–24|s2cid=18326990 |doi-access=free }}</ref><ref name="kawash">[https://www.thefreelibrary.com/Complex+quantification+in+Structured+Query+Language+(SQL):+a+tutorial...-a0119901477 Kawash, Jalal (2004) Complex quantification in Structured Query Language (SQL): a tutorial using relational calculus]; ''Journal of Computers in Mathematics and Science Teaching'' {{ISSN|0731-9258}} Volume 23, Issue 2, 2004 AACE Norfolk, Virginia. Thefreelibrary.com</ref> There is also the {{code|<row value expression> IS DISTINCT FROM <row value expression>}} infixed comparison operator, which returns TRUE unless both operands are equal or both are NULL. Likewise, IS NOT DISTINCT FROM is defined as {{code|NOT (<row value expression> IS DISTINCT FROM <row value expression>)}}. [[SQL:1999]] also introduced {{code|BOOLEAN}} type variables, which according to the standard can also hold Unknown values if it is nullable. In practice, a number of systems (e.g. [[PostgreSQL]]) implement the BOOLEAN Unknown as a BOOLEAN NULL, which the standard says that the NULL BOOLEAN and UNKNOWN "may be used interchangeably to mean exactly the same thing".<ref>{{cite book|author=C. Date|title=SQL and Relational Theory: How to Write Accurate SQL Code|url=https://books.google.com/books?id=Ew06OZtjuJEC&pg=PA83|year=2011|publisher=O'Reilly Media, Inc.|isbn=978-1-4493-1640-2|page=83}}</ref><ref>ISO/IEC 9075-2:2011 §4.5</ref></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Additionally, because SQL operators return Unknown when comparing anything with Null directly, SQL provides two Null-specific comparison predicates: {{code|IS NULL}} and {{code|IS NOT NULL}} test whether data is or is not Null.<ref name="SQL2003-Part2-Sec87">{{cite book | last = ISO/IEC | title = ISO/IEC 9075-2:2003, "SQL/Foundation" | publisher = ISO/IEC }}</ref> SQL does not explicitly support [[universal quantification]], and must work it out as a negated [[existential quantification]].<ref name="Negri">{{cite journal|title=Semantics and problems of universal quantification in SQL |doi=10.1093/comjnl/32.1.90 |journal=The Computer Journal |date= February 1989|volume=32 |issue=1 |pages=90–91 |last1=Negri |first1=M. |last2=Pelagatti |first2=G. |last3=Sbattella |first3=L. |doi-access=free }}</ref><ref name="Fratarcangeli">{{cite journal|url=https://dl.acm.org/doi/10.1145/126482.126484 |title=Technique for universal quantification in SQL |doi=10.1145/126482.126484 |journal=ACM SIGMOD Record |year = 1991|access-date=2024-11-07|last1 = Fratarcangeli|first1 = Claudio|volume = 20|issue = 3|pages = 16–24|s2cid=18326990 |doi-access=free <ins style="font-weight: bold; text-decoration: none;">|url-access=subscription</ins>}}</ref><ref name="kawash">[https://www.thefreelibrary.com/Complex+quantification+in+Structured+Query+Language+(SQL):+a+tutorial...-a0119901477 Kawash, Jalal (2004) Complex quantification in Structured Query Language (SQL): a tutorial using relational calculus]; ''Journal of Computers in Mathematics and Science Teaching'' {{ISSN|0731-9258}} Volume 23, Issue 2, 2004 AACE Norfolk, Virginia. Thefreelibrary.com</ref> There is also the {{code|<row value expression> IS DISTINCT FROM <row value expression>}} infixed comparison operator, which returns TRUE unless both operands are equal or both are NULL. Likewise, IS NOT DISTINCT FROM is defined as {{code|NOT (<row value expression> IS DISTINCT FROM <row value expression>)}}. [[SQL:1999]] also introduced {{code|BOOLEAN}} type variables, which according to the standard can also hold Unknown values if it is nullable. In practice, a number of systems (e.g. [[PostgreSQL]]) implement the BOOLEAN Unknown as a BOOLEAN NULL, which the standard says that the NULL BOOLEAN and UNKNOWN "may be used interchangeably to mean exactly the same thing".<ref>{{cite book|author=C. Date|title=SQL and Relational Theory: How to Write Accurate SQL Code|url=https://books.google.com/books?id=Ew06OZtjuJEC&pg=PA83|year=2011|publisher=O'Reilly Media, Inc.|isbn=978-1-4493-1640-2|page=83}}</ref><ref>ISO/IEC 9075-2:2011 §4.5</ref></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Data manipulation ===</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Data manipulation ===</div></td>
</tr>
</table>OAbothttps://en.wikipedia.org/w/index.php?title=SQL_syntax&diff=1271809618&oldid=prevAsilvering: Removing link(s) Wikipedia:Articles for deletion/Where (SQL) closed as delete (XFDcloser)2025-01-25T20:59:17Z<p>Removing link(s) <a href="/wiki/Wikipedia:Articles_for_deletion/Where_(SQL)" title="Wikipedia:Articles for deletion/Where (SQL)">Wikipedia:Articles for deletion/Where (SQL)</a> closed as delete (<a href="/wiki/Wikipedia:XFDC#4.0.16" class="mw-redirect" title="Wikipedia:XFDC">XFDcloser</a>)</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 20:59, 25 January 2025</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 157:</td>
<td colspan="2" class="diff-lineno">Line 157:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* The <code>[[From (SQL)|FROM]]</code> clause, which indicates the table(s) to retrieve data from. The {{code|FROM}} clause can include optional <code>[[Join (SQL)|JOIN]]</code> subclauses to specify the rules for joining tables.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* The <code>[[From (SQL)|FROM]]</code> clause, which indicates the table(s) to retrieve data from. The {{code|FROM}} clause can include optional <code>[[Join (SQL)|JOIN]]</code> subclauses to specify the rules for joining tables.</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* The <code><del style="font-weight: bold; text-decoration: none;">[[Where (SQL)|</del>WHERE<del style="font-weight: bold; text-decoration: none;">]]</del></code> clause includes a comparison predicate, which restricts the rows returned by the query. The {{code|WHERE}} clause eliminates all rows from the [[result set]] where the comparison predicate does not evaluate to True.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* The <code>WHERE</code> clause includes a comparison predicate, which restricts the rows returned by the query. The {{code|WHERE}} clause eliminates all rows from the [[result set]] where the comparison predicate does not evaluate to True.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* The <code>[[Group by (SQL)|GROUP BY]]</code> clause projects rows having common values into a smaller set of rows.{{Clarify|reason=|date=September 2020}} {{code|GROUP BY}} is often used in conjunction with SQL aggregation functions or to eliminate duplicate rows from a result set. The {{code|WHERE}} clause is applied before the {{code|GROUP BY}} clause.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* The <code>[[Group by (SQL)|GROUP BY]]</code> clause projects rows having common values into a smaller set of rows.{{Clarify|reason=|date=September 2020}} {{code|GROUP BY}} is often used in conjunction with SQL aggregation functions or to eliminate duplicate rows from a result set. The {{code|WHERE}} clause is applied before the {{code|GROUP BY}} clause.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* The <code>[[Having (SQL)|HAVING]]</code> clause includes a predicate used to filter rows resulting from the {{code|GROUP BY}} clause. Because it acts on the results of the {{code|GROUP BY}} clause, aggregation functions can be used in the {{code|HAVING}} clause predicate.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* The <code>[[Having (SQL)|HAVING]]</code> clause includes a predicate used to filter rows resulting from the {{code|GROUP BY}} clause. Because it acts on the results of the {{code|GROUP BY}} clause, aggregation functions can be used in the {{code|HAVING}} clause predicate.</div></td>
</tr>
<!-- diff cache key enwiki:diff:1.41:old-1271124346:rev-1271809618:wikidiff2=table:1.14.1:ff290eae -->
</table>Asilveringhttps://en.wikipedia.org/w/index.php?title=SQL_syntax&diff=1271124346&oldid=prevTheJH: /* External links */ add archive-url to dead link2025-01-22T18:04:51Z<p><span class="autocomment">External links: </span> add archive-url to dead link</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 18:04, 22 January 2025</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 601:</td>
<td colspan="2" class="diff-lineno">Line 601:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|n=no|s=no|q=no}}</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|n=no|s=no|q=no}}</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* {{Citation |url=https://standards.iso.org/iso-iec/9075/-2/ed-6/en/ISO_IEC_9075-2(E)_Foundation.bnf.xml |contribution=Definition of SQL grammar |title=ISO_IEC_9075-2(E)_Foundation.bnf.xml |publisher=ISO Standards Maintenance Portal |format=[[Backus–Naur form]] XML}}.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* {{Citation |url=https://standards.iso.org/iso-iec/9075/-2/ed-6/en/ISO_IEC_9075-2(E)_Foundation.bnf.xml |contribution=Definition of SQL grammar |title=ISO_IEC_9075-2(E)_Foundation.bnf.xml |publisher=ISO Standards Maintenance Portal |format=[[Backus–Naur form]] XML}}.</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* {{Citation |url=https://quickformatter.com/sql-formatter |contribution=Online SQL Formating Utility |title=Online SQL Formatter Utility}}.</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* {{Citation |url=https://quickformatter.com/sql-formatter |contribution=Online SQL Formating Utility |title=Online SQL Formatter Utility<ins style="font-weight: bold; text-decoration: none;"> |archive-url=https://web.archive.org/web/20240918172914/https://quickformatter.com/sql-formatter |archive-date=2024-09-18 |url-status=dead</ins>}}.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{SQL}}</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{SQL}}</div></td>
</tr>
</table>TheJHhttps://en.wikipedia.org/w/index.php?title=SQL_syntax&diff=1265894616&oldid=prevZ. Patterson: The journal article listed is free to read on the journal's website.2024-12-29T04:37:09Z<p>The journal article listed is free to read on the journal's website.</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 04:37, 29 December 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 406:</td>
<td colspan="2" class="diff-lineno">Line 406:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>There are however disputes about the semantic interpretation of Nulls in SQL because of its treatment outside direct comparisons. As seen in the table above, direct equality comparisons between two NULLs in SQL (e.g. {{code|NULL {{=}} NULL}}) return a truth value of Unknown. This is in line with the interpretation that Null does not have a value (and is not a member of any data domain) but is rather a placeholder or "mark" for missing information. However, the principle that two Nulls aren't equal to each other is effectively violated in the SQL specification for the {{code|UNION}} and {{code|INTERSECT}} operators, which do identify nulls with each other.<ref name="Meyden">[https://books.google.com/books?id=gF0b85IuqQwC&pg=PA344 Ron van der Meyden, "Logical approaches to incomplete information: a survey" in Chomicki, Jan; Saake, Gunter (Eds.) ''Logics for Databases and Information Systems'', Kluwer Academic Publishers] {{ISBN|978-0-7923-8129-7}}, p. 344</ref> Consequently, these [[Set operations (SQL)|set operations in SQL]] may produce results not representing sure information, unlike operations involving explicit comparisons with NULL (e.g. those in a {{code|WHERE}} clause discussed above). In Codd's 1979 proposal (which was basically adopted by SQL92) this semantic inconsistency is rationalized by arguing that removal of duplicates in set operations happens "at a lower level of detail than equality testing in the evaluation of retrieval operations".<ref name="Klein" /> However, computer-science professor Ron van der Meyden concluded that "The inconsistencies in the SQL standard mean that it is not possible to ascribe any intuitive logical semantics to the treatment of nulls in SQL."<ref name="Meyden" /></div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>There are however disputes about the semantic interpretation of Nulls in SQL because of its treatment outside direct comparisons. As seen in the table above, direct equality comparisons between two NULLs in SQL (e.g. {{code|NULL {{=}} NULL}}) return a truth value of Unknown. This is in line with the interpretation that Null does not have a value (and is not a member of any data domain) but is rather a placeholder or "mark" for missing information. However, the principle that two Nulls aren't equal to each other is effectively violated in the SQL specification for the {{code|UNION}} and {{code|INTERSECT}} operators, which do identify nulls with each other.<ref name="Meyden">[https://books.google.com/books?id=gF0b85IuqQwC&pg=PA344 Ron van der Meyden, "Logical approaches to incomplete information: a survey" in Chomicki, Jan; Saake, Gunter (Eds.) ''Logics for Databases and Information Systems'', Kluwer Academic Publishers] {{ISBN|978-0-7923-8129-7}}, p. 344</ref> Consequently, these [[Set operations (SQL)|set operations in SQL]] may produce results not representing sure information, unlike operations involving explicit comparisons with NULL (e.g. those in a {{code|WHERE}} clause discussed above). In Codd's 1979 proposal (which was basically adopted by SQL92) this semantic inconsistency is rationalized by arguing that removal of duplicates in set operations happens "at a lower level of detail than equality testing in the evaluation of retrieval operations".<ref name="Klein" /> However, computer-science professor Ron van der Meyden concluded that "The inconsistencies in the SQL standard mean that it is not possible to ascribe any intuitive logical semantics to the treatment of nulls in SQL."<ref name="Meyden" /></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Additionally, because SQL operators return Unknown when comparing anything with Null directly, SQL provides two Null-specific comparison predicates: {{code|IS NULL}} and {{code|IS NOT NULL}} test whether data is or is not Null.<ref name="SQL2003-Part2-Sec87">{{cite book | last = ISO/IEC | title = ISO/IEC 9075-2:2003, "SQL/Foundation" | publisher = ISO/IEC }}</ref> SQL does not explicitly support [[universal quantification]], and must work it out as a negated [[existential quantification]].<ref name="Negri">{{cite journal|title=Semantics and problems of universal quantification in SQL |doi=10.1093/comjnl/32.1.90 |journal=The Computer Journal |date= February 1989|volume=32 |issue=1 |pages=90–91 |last1=Negri |first1=M. |last2=Pelagatti |first2=G. |last3=Sbattella |first3=L. |doi-access=free }}</ref><ref name="Fratarcangeli">{{cite journal|url=https://dl.acm.org/doi/10.1145/126482.126484 |title=Technique for universal quantification in SQL |doi=10.1145/126482.126484 |journal=ACM SIGMOD Record |year = 1991|access-date=2024-11-07|last1 = Fratarcangeli|first1 = Claudio|volume = 20|issue = 3|pages = 16–24|s2cid=18326990 }}</ref><ref name="kawash">[https://www.thefreelibrary.com/Complex+quantification+in+Structured+Query+Language+(SQL):+a+tutorial...-a0119901477 Kawash, Jalal (2004) Complex quantification in Structured Query Language (SQL): a tutorial using relational calculus]; ''Journal of Computers in Mathematics and Science Teaching'' {{ISSN|0731-9258}} Volume 23, Issue 2, 2004 AACE Norfolk, Virginia. Thefreelibrary.com</ref> There is also the {{code|<row value expression> IS DISTINCT FROM <row value expression>}} infixed comparison operator, which returns TRUE unless both operands are equal or both are NULL. Likewise, IS NOT DISTINCT FROM is defined as {{code|NOT (<row value expression> IS DISTINCT FROM <row value expression>)}}. [[SQL:1999]] also introduced {{code|BOOLEAN}} type variables, which according to the standard can also hold Unknown values if it is nullable. In practice, a number of systems (e.g. [[PostgreSQL]]) implement the BOOLEAN Unknown as a BOOLEAN NULL, which the standard says that the NULL BOOLEAN and UNKNOWN "may be used interchangeably to mean exactly the same thing".<ref>{{cite book|author=C. Date|title=SQL and Relational Theory: How to Write Accurate SQL Code|url=https://books.google.com/books?id=Ew06OZtjuJEC&pg=PA83|year=2011|publisher=O'Reilly Media, Inc.|isbn=978-1-4493-1640-2|page=83}}</ref><ref>ISO/IEC 9075-2:2011 §4.5</ref></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Additionally, because SQL operators return Unknown when comparing anything with Null directly, SQL provides two Null-specific comparison predicates: {{code|IS NULL}} and {{code|IS NOT NULL}} test whether data is or is not Null.<ref name="SQL2003-Part2-Sec87">{{cite book | last = ISO/IEC | title = ISO/IEC 9075-2:2003, "SQL/Foundation" | publisher = ISO/IEC }}</ref> SQL does not explicitly support [[universal quantification]], and must work it out as a negated [[existential quantification]].<ref name="Negri">{{cite journal|title=Semantics and problems of universal quantification in SQL |doi=10.1093/comjnl/32.1.90 |journal=The Computer Journal |date= February 1989|volume=32 |issue=1 |pages=90–91 |last1=Negri |first1=M. |last2=Pelagatti |first2=G. |last3=Sbattella |first3=L. |doi-access=free }}</ref><ref name="Fratarcangeli">{{cite journal|url=https://dl.acm.org/doi/10.1145/126482.126484 |title=Technique for universal quantification in SQL |doi=10.1145/126482.126484 |journal=ACM SIGMOD Record |year = 1991|access-date=2024-11-07|last1 = Fratarcangeli|first1 = Claudio|volume = 20|issue = 3|pages = 16–24|s2cid=18326990<ins style="font-weight: bold; text-decoration: none;"> |doi-access=free</ins> }}</ref><ref name="kawash">[https://www.thefreelibrary.com/Complex+quantification+in+Structured+Query+Language+(SQL):+a+tutorial...-a0119901477 Kawash, Jalal (2004) Complex quantification in Structured Query Language (SQL): a tutorial using relational calculus]; ''Journal of Computers in Mathematics and Science Teaching'' {{ISSN|0731-9258}} Volume 23, Issue 2, 2004 AACE Norfolk, Virginia. Thefreelibrary.com</ref> There is also the {{code|<row value expression> IS DISTINCT FROM <row value expression>}} infixed comparison operator, which returns TRUE unless both operands are equal or both are NULL. Likewise, IS NOT DISTINCT FROM is defined as {{code|NOT (<row value expression> IS DISTINCT FROM <row value expression>)}}. [[SQL:1999]] also introduced {{code|BOOLEAN}} type variables, which according to the standard can also hold Unknown values if it is nullable. In practice, a number of systems (e.g. [[PostgreSQL]]) implement the BOOLEAN Unknown as a BOOLEAN NULL, which the standard says that the NULL BOOLEAN and UNKNOWN "may be used interchangeably to mean exactly the same thing".<ref>{{cite book|author=C. Date|title=SQL and Relational Theory: How to Write Accurate SQL Code|url=https://books.google.com/books?id=Ew06OZtjuJEC&pg=PA83|year=2011|publisher=O'Reilly Media, Inc.|isbn=978-1-4493-1640-2|page=83}}</ref><ref>ISO/IEC 9075-2:2011 §4.5</ref></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Data manipulation ===</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Data manipulation ===</div></td>
</tr>
</table>Z. Pattersonhttps://en.wikipedia.org/w/index.php?title=SQL_syntax&diff=1262509200&oldid=prevCitation bot: Altered url. URLs might have been anonymized. Add: archive-date, archive-url. Removed URL that duplicated identifier. Removed access-date with no URL. | Use this bot. Report bugs. | Suggested by Dominic3203 | Category:Query languages | #UCB_Category 56/662024-12-11T20:10:46Z<p>Altered url. URLs might have been anonymized. Add: archive-date, archive-url. Removed URL that duplicated identifier. Removed access-date with no URL. | <a href="/wiki/Wikipedia:UCB" class="mw-redirect" title="Wikipedia:UCB">Use this bot</a>. <a href="/wiki/Wikipedia:DBUG" class="mw-redirect" title="Wikipedia:DBUG">Report bugs</a>. | Suggested by Dominic3203 | <a href="/wiki/Category:Query_languages" title="Category:Query languages">Category:Query languages</a> | #UCB_Category 56/66</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 20:10, 11 December 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 304:</td>
<td colspan="2" class="diff-lineno">Line 304:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The concept of [[Null (SQL)|Null]] allows SQL to deal with missing information in the relational model. The word {{code|NULL}} is a reserved keyword in SQL, used to identify the Null special marker. Comparisons with Null, for instance equality (=) in WHERE clauses, results in an Unknown truth value. In SELECT statements SQL returns only results for which the WHERE clause returns a value of True; i.e., it excludes results with values of False and also excludes those whose value is Unknown.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The concept of [[Null (SQL)|Null]] allows SQL to deal with missing information in the relational model. The word {{code|NULL}} is a reserved keyword in SQL, used to identify the Null special marker. Comparisons with Null, for instance equality (=) in WHERE clauses, results in an Unknown truth value. In SELECT statements SQL returns only results for which the WHERE clause returns a value of True; i.e., it excludes results with values of False and also excludes those whose value is Unknown.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Along with True and False, the Unknown resulting from direct comparisons with Null thus brings a fragment of [[three-valued logic]] to SQL. The truth tables SQL uses for AND, OR, and NOT correspond to a common fragment of the Kleene and Lukasiewicz three-valued logic (which differ in their definition of implication, however SQL defines no such operation).<ref name="Klein">{{Cite book | last1 = Hans-Joachim | first1 = K. | chapter = Null Values in Relational Databases and Sure Information Answers | doi = 10.1007/3-540-36596-6_7 | title = Semantics in Databases. Second International Workshop Dagstuhl Castle, Germany, January 7–12, 2001. Revised Papers | series = Lecture Notes in Computer Science | volume = 2582 | pages = 119–138| year = 2003 | isbn = 978-3-540-00957-3 | url = https://web.archive.org/web/20180707170027/http://www.is.informatik.uni-kiel.de/~hjk/sqlni.ps}}</ref></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Along with True and False, the Unknown resulting from direct comparisons with Null thus brings a fragment of [[three-valued logic]] to SQL. The truth tables SQL uses for AND, OR, and NOT correspond to a common fragment of the Kleene and Lukasiewicz three-valued logic (which differ in their definition of implication, however SQL defines no such operation).<ref name="Klein">{{Cite book | last1 = Hans-Joachim | first1 = K. | chapter = Null Values in Relational Databases and Sure Information Answers | doi = 10.1007/3-540-36596-6_7 | title = Semantics in Databases. Second International Workshop Dagstuhl Castle, Germany, January 7–12, 2001. Revised Papers | series = Lecture Notes in Computer Science | volume = 2582 | pages = 119–138| year = 2003 | isbn = 978-3-540-00957-3 | <ins style="font-weight: bold; text-decoration: none;">url = http://www.is.informatik.uni-kiel.de/~hjk/sqlni.ps| archive-</ins>url = https://web.archive.org/web/20180707170027/http://www.is.informatik.uni-kiel.de/~hjk/sqlni.ps<ins style="font-weight: bold; text-decoration: none;"> | archive-date = 7 July 2018 </ins>}}</ref></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{| border="0"</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{| border="0"</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 406:</td>
<td colspan="2" class="diff-lineno">Line 406:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>There are however disputes about the semantic interpretation of Nulls in SQL because of its treatment outside direct comparisons. As seen in the table above, direct equality comparisons between two NULLs in SQL (e.g. {{code|NULL {{=}} NULL}}) return a truth value of Unknown. This is in line with the interpretation that Null does not have a value (and is not a member of any data domain) but is rather a placeholder or "mark" for missing information. However, the principle that two Nulls aren't equal to each other is effectively violated in the SQL specification for the {{code|UNION}} and {{code|INTERSECT}} operators, which do identify nulls with each other.<ref name="Meyden">[https://books.google.com/books?id=gF0b85IuqQwC&pg=PA344 Ron van der Meyden, "Logical approaches to incomplete information: a survey" in Chomicki, Jan; Saake, Gunter (Eds.) ''Logics for Databases and Information Systems'', Kluwer Academic Publishers] {{ISBN|978-0-7923-8129-7}}, p. 344</ref> Consequently, these [[Set operations (SQL)|set operations in SQL]] may produce results not representing sure information, unlike operations involving explicit comparisons with NULL (e.g. those in a {{code|WHERE}} clause discussed above). In Codd's 1979 proposal (which was basically adopted by SQL92) this semantic inconsistency is rationalized by arguing that removal of duplicates in set operations happens "at a lower level of detail than equality testing in the evaluation of retrieval operations".<ref name="Klein" /> However, computer-science professor Ron van der Meyden concluded that "The inconsistencies in the SQL standard mean that it is not possible to ascribe any intuitive logical semantics to the treatment of nulls in SQL."<ref name="Meyden" /></div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>There are however disputes about the semantic interpretation of Nulls in SQL because of its treatment outside direct comparisons. As seen in the table above, direct equality comparisons between two NULLs in SQL (e.g. {{code|NULL {{=}} NULL}}) return a truth value of Unknown. This is in line with the interpretation that Null does not have a value (and is not a member of any data domain) but is rather a placeholder or "mark" for missing information. However, the principle that two Nulls aren't equal to each other is effectively violated in the SQL specification for the {{code|UNION}} and {{code|INTERSECT}} operators, which do identify nulls with each other.<ref name="Meyden">[https://books.google.com/books?id=gF0b85IuqQwC&pg=PA344 Ron van der Meyden, "Logical approaches to incomplete information: a survey" in Chomicki, Jan; Saake, Gunter (Eds.) ''Logics for Databases and Information Systems'', Kluwer Academic Publishers] {{ISBN|978-0-7923-8129-7}}, p. 344</ref> Consequently, these [[Set operations (SQL)|set operations in SQL]] may produce results not representing sure information, unlike operations involving explicit comparisons with NULL (e.g. those in a {{code|WHERE}} clause discussed above). In Codd's 1979 proposal (which was basically adopted by SQL92) this semantic inconsistency is rationalized by arguing that removal of duplicates in set operations happens "at a lower level of detail than equality testing in the evaluation of retrieval operations".<ref name="Klein" /> However, computer-science professor Ron van der Meyden concluded that "The inconsistencies in the SQL standard mean that it is not possible to ascribe any intuitive logical semantics to the treatment of nulls in SQL."<ref name="Meyden" /></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Additionally, because SQL operators return Unknown when comparing anything with Null directly, SQL provides two Null-specific comparison predicates: {{code|IS NULL}} and {{code|IS NOT NULL}} test whether data is or is not Null.<ref name="SQL2003-Part2-Sec87">{{cite book | last = ISO/IEC | title = ISO/IEC 9075-2:2003, "SQL/Foundation" | publisher = ISO/IEC }}</ref> SQL does not explicitly support [[universal quantification]], and must work it out as a negated [[existential quantification]].<ref name="Negri">{{cite journal<del style="font-weight: bold; text-decoration: none;">|url=https://dl.acm.org/doi/10.1093/comjnl/32.1.90 </del>|title=Semantics and problems of universal quantification in SQL |doi=10.1093/comjnl/32.1.90 |journal=The Computer Journal |date= February 1989|volume=32 |issue=1 |pages=90–91 <del style="font-weight: bold; text-decoration: none;">|access-date=2024-11-07</del>|last1=Negri |first1=M. |last2=Pelagatti |first2=G. |last3=Sbattella |first3=L. |doi-access=free }}</ref><ref name="Fratarcangeli">{{cite journal|url=https://dl.acm.org/doi/10.1145/126482.126484 |title=Technique for universal quantification in SQL |doi=10.1145/126482.126484 |journal=ACM SIGMOD Record |year = 1991|access-date=2024-11-07|last1 = Fratarcangeli|first1 = Claudio|volume = 20|issue = 3|pages = 16–24|s2cid=18326990 }}</ref><ref name="kawash">[https://www.thefreelibrary.com/Complex+quantification+in+Structured+Query+Language+(SQL):+a+tutorial...-a0119901477 Kawash, Jalal (2004) Complex quantification in Structured Query Language (SQL): a tutorial using relational calculus]; ''Journal of Computers in Mathematics and Science Teaching'' {{ISSN|0731-9258}} Volume 23, Issue 2, 2004 AACE Norfolk, Virginia. Thefreelibrary.com</ref> There is also the {{code|<row value expression> IS DISTINCT FROM <row value expression>}} infixed comparison operator, which returns TRUE unless both operands are equal or both are NULL. Likewise, IS NOT DISTINCT FROM is defined as {{code|NOT (<row value expression> IS DISTINCT FROM <row value expression>)}}. [[SQL:1999]] also introduced {{code|BOOLEAN}} type variables, which according to the standard can also hold Unknown values if it is nullable. In practice, a number of systems (e.g. [[PostgreSQL]]) implement the BOOLEAN Unknown as a BOOLEAN NULL, which the standard says that the NULL BOOLEAN and UNKNOWN "may be used interchangeably to mean exactly the same thing".<ref>{{cite book|author=C. Date|title=SQL and Relational Theory: How to Write Accurate SQL Code|url=https://books.google.com/books?id=Ew06OZtjuJEC&pg=PA83|year=2011|publisher=O'Reilly Media, Inc.|isbn=978-1-4493-1640-2|page=83}}</ref><ref>ISO/IEC 9075-2:2011 §4.5</ref></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Additionally, because SQL operators return Unknown when comparing anything with Null directly, SQL provides two Null-specific comparison predicates: {{code|IS NULL}} and {{code|IS NOT NULL}} test whether data is or is not Null.<ref name="SQL2003-Part2-Sec87">{{cite book | last = ISO/IEC | title = ISO/IEC 9075-2:2003, "SQL/Foundation" | publisher = ISO/IEC }}</ref> SQL does not explicitly support [[universal quantification]], and must work it out as a negated [[existential quantification]].<ref name="Negri">{{cite journal|title=Semantics and problems of universal quantification in SQL |doi=10.1093/comjnl/32.1.90 |journal=The Computer Journal |date= February 1989|volume=32 |issue=1 |pages=90–91 |last1=Negri |first1=M. |last2=Pelagatti |first2=G. |last3=Sbattella |first3=L. |doi-access=free }}</ref><ref name="Fratarcangeli">{{cite journal|url=https://dl.acm.org/doi/10.1145/126482.126484 |title=Technique for universal quantification in SQL |doi=10.1145/126482.126484 |journal=ACM SIGMOD Record |year = 1991|access-date=2024-11-07|last1 = Fratarcangeli|first1 = Claudio|volume = 20|issue = 3|pages = 16–24|s2cid=18326990 }}</ref><ref name="kawash">[https://www.thefreelibrary.com/Complex+quantification+in+Structured+Query+Language+(SQL):+a+tutorial...-a0119901477 Kawash, Jalal (2004) Complex quantification in Structured Query Language (SQL): a tutorial using relational calculus]; ''Journal of Computers in Mathematics and Science Teaching'' {{ISSN|0731-9258}} Volume 23, Issue 2, 2004 AACE Norfolk, Virginia. Thefreelibrary.com</ref> There is also the {{code|<row value expression> IS DISTINCT FROM <row value expression>}} infixed comparison operator, which returns TRUE unless both operands are equal or both are NULL. Likewise, IS NOT DISTINCT FROM is defined as {{code|NOT (<row value expression> IS DISTINCT FROM <row value expression>)}}. [[SQL:1999]] also introduced {{code|BOOLEAN}} type variables, which according to the standard can also hold Unknown values if it is nullable. In practice, a number of systems (e.g. [[PostgreSQL]]) implement the BOOLEAN Unknown as a BOOLEAN NULL, which the standard says that the NULL BOOLEAN and UNKNOWN "may be used interchangeably to mean exactly the same thing".<ref>{{cite book|author=C. Date|title=SQL and Relational Theory: How to Write Accurate SQL Code|url=https://books.google.com/books?id=Ew06OZtjuJEC&pg=PA83|year=2011|publisher=O'Reilly Media, Inc.|isbn=978-1-4493-1640-2|page=83}}</ref><ref>ISO/IEC 9075-2:2011 §4.5</ref></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Data manipulation ===</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Data manipulation ===</div></td>
</tr>
</table>Citation bothttps://en.wikipedia.org/w/index.php?title=SQL_syntax&diff=1261384360&oldid=prevIznoRepeat: add WP:TEMPLATECAT to remove from template; genfixes, added Empty section (1) tag2024-12-05T20:42:07Z<p>add <a href="/wiki/Wikipedia:TEMPLATECAT" class="mw-redirect" title="Wikipedia:TEMPLATECAT">WP:TEMPLATECAT</a> to remove from template; genfixes, added Empty section (1) tag</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 20:42, 5 December 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 591:</td>
<td colspan="2" class="diff-lineno">Line 591:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></syntaxhighlight></div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></syntaxhighlight></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>==<del style="font-weight: bold; text-decoration: none;"> Notes </del>==</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>==<ins style="font-weight: bold; text-decoration: none;">References</ins>==</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_6_2_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_2_0_rhs"></a>{{Reflist}}</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Paragraph was moved. Click to jump to old location." href="#movedpara_6_4_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_4_0_rhs"></a>==External links==</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Sister project links</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Sister project links</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|commons=Category:Structured Query Language</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|commons=Category:Structured Query Language</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 598:</td>
<td colspan="2" class="diff-lineno">Line 600:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|b=Structured Query Language</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|b=Structured Query Language</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|n=no|s=no|q=no}}</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|n=no|s=no|q=no}}</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>==References==</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_2_0_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_6_2_lhs"></a>{{Reflist}}</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Paragraph was moved. Click to jump to new location." href="#movedpara_4_0_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_6_4_lhs"></a>==External links==</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* {{Citation |url=https://standards.iso.org/iso-iec/9075/-2/ed-6/en/ISO_IEC_9075-2(E)_Foundation.bnf.xml |contribution=Definition of SQL grammar |title=ISO_IEC_9075-2(E)_Foundation.bnf.xml |publisher=ISO Standards Maintenance Portal |format=[[Backus–Naur form]] XML}}.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* {{Citation |url=https://standards.iso.org/iso-iec/9075/-2/ed-6/en/ISO_IEC_9075-2(E)_Foundation.bnf.xml |contribution=Definition of SQL grammar |title=ISO_IEC_9075-2(E)_Foundation.bnf.xml |publisher=ISO Standards Maintenance Portal |format=[[Backus–Naur form]] XML}}.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* {{Citation |url=https://quickformatter.com/sql-formatter |contribution=Online SQL Formating Utility |title=Online SQL Formatter Utility}}.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* {{Citation |url=https://quickformatter.com/sql-formatter |contribution=Online SQL Formating Utility |title=Online SQL Formatter Utility}}.</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{SQL}}</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{SQL}}</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 619:</td>
<td colspan="2" class="diff-lineno">Line 615:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Data modeling languages]]</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Data modeling languages]]</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Relational database management systems]]</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Relational database management systems]]</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[Category:Database management systems]]</div></td>
</tr>
</table>IznoRepeathttps://en.wikipedia.org/w/index.php?title=SQL_syntax&diff=1255924473&oldid=prev2600:6C5E:1F00:1489:0:0:0:19F2 at 08:46, 7 November 20242024-11-07T08:46:13Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 08:46, 7 November 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 150:</td>
<td colspan="2" class="diff-lineno">Line 150:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Queries ==</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Queries ==</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The most common operation in SQL, the query, makes use of the declarative <code>[[Select (SQL)|SELECT]]</code> statement. {{code|SELECT}} retrieves data from one or more [[Table (database)|table]]s, or expressions. Standard {{code|SELECT}} statements have no persistent effects on the database. Some non-standard implementations of {{code|SELECT}} can have persistent effects, such as the {{code|SELECT INTO}} syntax provided in some databases.<ref name="ms-sql-select-into">{{cite <del style="font-weight: bold; text-decoration: none;">book </del>|<del style="font-weight: bold; text-decoration: none;"> chapter </del>=<del style="font-weight: bold; text-decoration: none;"> Transact</del>-<del style="font-weight: bold; text-decoration: none;">SQL Reference </del>|<del style="font-weight: bold; text-decoration: none;"> </del>title<del style="font-weight: bold; text-decoration: none;"> </del>= <del style="font-weight: bold; text-decoration: none;">SQL</del> <del style="font-weight: bold; text-decoration: none;">Server</del> <del style="font-weight: bold; text-decoration: none;">Language Reference | series =</del> SQL<del style="font-weight: bold; text-decoration: none;"> Server 2005 Books Online </del>|<del style="font-weight: bold; text-decoration: none;"> publisher </del>=<del style="font-weight: bold; text-decoration: none;"> Microsoft </del>|<del style="font-weight: bold; text-decoration: none;"> </del>date<del style="font-weight: bold; text-decoration: none;"> </del>=<del style="font-weight: bold; text-decoration: none;"> 2007</del>-<del style="font-weight: bold; text-decoration: none;">09</del>-<del style="font-weight: bold; text-decoration: none;">15 </del>|<del style="font-weight: bold; text-decoration: none;"> url = http://msdn.microsoft.com/en-us/library/ms188029.aspx | </del>access-date<del style="font-weight: bold; text-decoration: none;"> </del>=<del style="font-weight: bold; text-decoration: none;"> 2007</del>-<del style="font-weight: bold; text-decoration: none;">06</del>-<del style="font-weight: bold; text-decoration: none;">17 </del>}}</ref></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The most common operation in SQL, the query, makes use of the declarative <code>[[Select (SQL)|SELECT]]</code> statement. {{code|SELECT}} retrieves data from one or more [[Table (database)|table]]s, or expressions. Standard {{code|SELECT}} statements have no persistent effects on the database. Some non-standard implementations of {{code|SELECT}} can have persistent effects, such as the {{code|SELECT INTO}} syntax provided in some databases.<ref name="ms-sql-select-into">{{cite <ins style="font-weight: bold; text-decoration: none;">web</ins>|<ins style="font-weight: bold; text-decoration: none;">url</ins>=<ins style="font-weight: bold; text-decoration: none;">https://learn.microsoft.com/en</ins>-<ins style="font-weight: bold; text-decoration: none;">us/sql/t-sql/queries/select-into-clause-transact-sql</ins>|title=<ins style="font-weight: bold; text-decoration: none;">SELECT</ins> <ins style="font-weight: bold; text-decoration: none;">-</ins> <ins style="font-weight: bold; text-decoration: none;">INTO</ins> <ins style="font-weight: bold; text-decoration: none;">Clause</ins> <ins style="font-weight: bold; text-decoration: none;">(Transact-</ins>SQL<ins style="font-weight: bold; text-decoration: none;">)</ins>|<ins style="font-weight: bold; text-decoration: none;">website</ins>=<ins style="font-weight: bold; text-decoration: none;">learn.microsoft.com</ins>|date=<ins style="font-weight: bold; text-decoration: none;">2023</ins>-<ins style="font-weight: bold; text-decoration: none;">05</ins>-<ins style="font-weight: bold; text-decoration: none;">23</ins>|access-date=<ins style="font-weight: bold; text-decoration: none;">2024</ins>-<ins style="font-weight: bold; text-decoration: none;">11</ins>-<ins style="font-weight: bold; text-decoration: none;">07</ins>}}</ref></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Queries allow the user to describe desired data, leaving the [[Database management system|database management system (DBMS)]] to carry out [[query plan|planning]], [[query optimizer|optimizing]], and performing the physical operations necessary to produce that result as it chooses.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Queries allow the user to describe desired data, leaving the [[Database management system|database management system (DBMS)]] to carry out [[query plan|planning]], [[query optimizer|optimizing]], and performing the physical operations necessary to produce that result as it chooses.</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 304:</td>
<td colspan="2" class="diff-lineno">Line 304:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The concept of [[Null (SQL)|Null]] allows SQL to deal with missing information in the relational model. The word {{code|NULL}} is a reserved keyword in SQL, used to identify the Null special marker. Comparisons with Null, for instance equality (=) in WHERE clauses, results in an Unknown truth value. In SELECT statements SQL returns only results for which the WHERE clause returns a value of True; i.e., it excludes results with values of False and also excludes those whose value is Unknown.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The concept of [[Null (SQL)|Null]] allows SQL to deal with missing information in the relational model. The word {{code|NULL}} is a reserved keyword in SQL, used to identify the Null special marker. Comparisons with Null, for instance equality (=) in WHERE clauses, results in an Unknown truth value. In SELECT statements SQL returns only results for which the WHERE clause returns a value of True; i.e., it excludes results with values of False and also excludes those whose value is Unknown.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Along with True and False, the Unknown resulting from direct comparisons with Null thus brings a fragment of [[three-valued logic]] to SQL. The truth tables SQL uses for AND, OR, and NOT correspond to a common fragment of the Kleene and Lukasiewicz three-valued logic (which differ in their definition of implication, however SQL defines no such operation).<ref name="Klein">{{Cite book | last1 = Hans-Joachim | first1 = K. | chapter = Null Values in Relational Databases and Sure Information Answers | doi = 10.1007/3-540-36596-6_7 | title = Semantics in Databases. Second International Workshop Dagstuhl Castle, Germany, January 7–12, 2001. Revised Papers | series = Lecture Notes in Computer Science | volume = 2582 | pages = 119–138| year = 2003 | isbn = 978-3-540-00957-3 | url = http://www.is.informatik.uni-kiel.de/~hjk/sqlni.ps}}</ref></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Along with True and False, the Unknown resulting from direct comparisons with Null thus brings a fragment of [[three-valued logic]] to SQL. The truth tables SQL uses for AND, OR, and NOT correspond to a common fragment of the Kleene and Lukasiewicz three-valued logic (which differ in their definition of implication, however SQL defines no such operation).<ref name="Klein">{{Cite book | last1 = Hans-Joachim | first1 = K. | chapter = Null Values in Relational Databases and Sure Information Answers | doi = 10.1007/3-540-36596-6_7 | title = Semantics in Databases. Second International Workshop Dagstuhl Castle, Germany, January 7–12, 2001. Revised Papers | series = Lecture Notes in Computer Science | volume = 2582 | pages = 119–138| year = 2003 | isbn = 978-3-540-00957-3 | url = <ins style="font-weight: bold; text-decoration: none;">https://web.archive.org/web/20180707170027/</ins>http://www.is.informatik.uni-kiel.de/~hjk/sqlni.ps}}</ref></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{| border="0"</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{| border="0"</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Line 406:</td>
<td colspan="2" class="diff-lineno">Line 406:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>There are however disputes about the semantic interpretation of Nulls in SQL because of its treatment outside direct comparisons. As seen in the table above, direct equality comparisons between two NULLs in SQL (e.g. {{code|NULL {{=}} NULL}}) return a truth value of Unknown. This is in line with the interpretation that Null does not have a value (and is not a member of any data domain) but is rather a placeholder or "mark" for missing information. However, the principle that two Nulls aren't equal to each other is effectively violated in the SQL specification for the {{code|UNION}} and {{code|INTERSECT}} operators, which do identify nulls with each other.<ref name="Meyden">[https://books.google.com/books?id=gF0b85IuqQwC&pg=PA344 Ron van der Meyden, "Logical approaches to incomplete information: a survey" in Chomicki, Jan; Saake, Gunter (Eds.) ''Logics for Databases and Information Systems'', Kluwer Academic Publishers] {{ISBN|978-0-7923-8129-7}}, p. 344</ref> Consequently, these [[Set operations (SQL)|set operations in SQL]] may produce results not representing sure information, unlike operations involving explicit comparisons with NULL (e.g. those in a {{code|WHERE}} clause discussed above). In Codd's 1979 proposal (which was basically adopted by SQL92) this semantic inconsistency is rationalized by arguing that removal of duplicates in set operations happens "at a lower level of detail than equality testing in the evaluation of retrieval operations".<ref name="Klein" /> However, computer-science professor Ron van der Meyden concluded that "The inconsistencies in the SQL standard mean that it is not possible to ascribe any intuitive logical semantics to the treatment of nulls in SQL."<ref name="Meyden" /></div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>There are however disputes about the semantic interpretation of Nulls in SQL because of its treatment outside direct comparisons. As seen in the table above, direct equality comparisons between two NULLs in SQL (e.g. {{code|NULL {{=}} NULL}}) return a truth value of Unknown. This is in line with the interpretation that Null does not have a value (and is not a member of any data domain) but is rather a placeholder or "mark" for missing information. However, the principle that two Nulls aren't equal to each other is effectively violated in the SQL specification for the {{code|UNION}} and {{code|INTERSECT}} operators, which do identify nulls with each other.<ref name="Meyden">[https://books.google.com/books?id=gF0b85IuqQwC&pg=PA344 Ron van der Meyden, "Logical approaches to incomplete information: a survey" in Chomicki, Jan; Saake, Gunter (Eds.) ''Logics for Databases and Information Systems'', Kluwer Academic Publishers] {{ISBN|978-0-7923-8129-7}}, p. 344</ref> Consequently, these [[Set operations (SQL)|set operations in SQL]] may produce results not representing sure information, unlike operations involving explicit comparisons with NULL (e.g. those in a {{code|WHERE}} clause discussed above). In Codd's 1979 proposal (which was basically adopted by SQL92) this semantic inconsistency is rationalized by arguing that removal of duplicates in set operations happens "at a lower level of detail than equality testing in the evaluation of retrieval operations".<ref name="Klein" /> However, computer-science professor Ron van der Meyden concluded that "The inconsistencies in the SQL standard mean that it is not possible to ascribe any intuitive logical semantics to the treatment of nulls in SQL."<ref name="Meyden" /></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Additionally, because SQL operators return Unknown when comparing anything with Null directly, SQL provides two Null-specific comparison predicates: {{code|IS NULL}} and {{code|IS NOT NULL}} test whether data is or is not Null.<ref name="SQL2003-Part2-Sec87">{{cite book | last = ISO/IEC | title = ISO/IEC 9075-2:2003, "SQL/Foundation" | publisher = ISO/IEC }}</ref> SQL does not explicitly support [[universal quantification]], and must work it out as a negated [[existential quantification]].<ref name="Negri">{{cite journal|url=<del style="font-weight: bold; text-decoration: none;">http</del>://<del style="font-weight: bold; text-decoration: none;">portal</del>.acm.org/<del style="font-weight: bold; text-decoration: none;">citation</del>.<del style="font-weight: bold; text-decoration: none;">cfm?id=63224</del>.<del style="font-weight: bold; text-decoration: none;">68822&coll=GUIDE&dl=</del> |title=Semantics and problems of universal quantification in SQL |doi=10.1093/comjnl/32.1.90 |journal=The Computer Journal |date= February 1989|volume=32 |issue=1 |pages=90–91 |access-date=<del style="font-weight: bold; text-decoration: none;">2017</del>-<del style="font-weight: bold; text-decoration: none;">01</del>-<del style="font-weight: bold; text-decoration: none;">16</del>|last1=Negri |first1=M. |last2=Pelagatti |first2=G. |last3=Sbattella |first3=L. |doi-access=free }}</ref><ref name="Fratarcangeli">{{cite journal|url=<del style="font-weight: bold; text-decoration: none;">http</del>://<del style="font-weight: bold; text-decoration: none;">portal</del>.acm.org/<del style="font-weight: bold; text-decoration: none;">citation</del>.<del style="font-weight: bold; text-decoration: none;">cfm?id=</del>126482.126484<del style="font-weight: bold; text-decoration: none;">&coll=GUIDE&dl=GUIDE&CFID=5934371&CFTOKEN=55309005</del> |title=Technique for universal quantification in SQL |doi=10.1145/126482.126484 |journal=ACM SIGMOD Record |year = 1991|access-date=<del style="font-weight: bold; text-decoration: none;">2017</del>-<del style="font-weight: bold; text-decoration: none;">01</del>-<del style="font-weight: bold; text-decoration: none;">16</del>|last1 = Fratarcangeli|first1 = Claudio|volume = 20|issue = 3|pages = 16–24|s2cid=18326990 }}</ref><ref name="kawash">[<del style="font-weight: bold; text-decoration: none;">http</del>://www.thefreelibrary.com/Complex+quantification+in+Structured+Query+Language+(SQL):+a+tutorial...-a0119901477 Kawash, Jalal (2004) Complex quantification in Structured Query Language (SQL): a tutorial using relational calculus]; ''Journal of Computers in Mathematics and Science Teaching'' {{ISSN|0731-9258}} Volume 23, Issue 2, 2004 AACE Norfolk, Virginia. Thefreelibrary.com</ref> There is also the {{code|<row value expression> IS DISTINCT FROM <row value expression>}} infixed comparison operator, which returns TRUE unless both operands are equal or both are NULL. Likewise, IS NOT DISTINCT FROM is defined as {{code|NOT (<row value expression> IS DISTINCT FROM <row value expression>)}}. [[SQL:1999]] also introduced {{code|BOOLEAN}} type variables, which according to the standard can also hold Unknown values if it is nullable. In practice, a number of systems (e.g. [[PostgreSQL]]) implement the BOOLEAN Unknown as a BOOLEAN NULL, which the standard says that the NULL BOOLEAN and UNKNOWN "may be used interchangeably to mean exactly the same thing".<ref>{{cite book|author=C. Date|title=SQL and Relational Theory: How to Write Accurate SQL Code|url=https://books.google.com/books?id=Ew06OZtjuJEC&pg=PA83|year=2011|publisher=O'Reilly Media, Inc.|isbn=978-1-4493-1640-2|page=83}}</ref><ref>ISO/IEC 9075-2:2011 §4.5</ref></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Additionally, because SQL operators return Unknown when comparing anything with Null directly, SQL provides two Null-specific comparison predicates: {{code|IS NULL}} and {{code|IS NOT NULL}} test whether data is or is not Null.<ref name="SQL2003-Part2-Sec87">{{cite book | last = ISO/IEC | title = ISO/IEC 9075-2:2003, "SQL/Foundation" | publisher = ISO/IEC }}</ref> SQL does not explicitly support [[universal quantification]], and must work it out as a negated [[existential quantification]].<ref name="Negri">{{cite journal|url=<ins style="font-weight: bold; text-decoration: none;">https</ins>://<ins style="font-weight: bold; text-decoration: none;">dl</ins>.acm.org/<ins style="font-weight: bold; text-decoration: none;">doi/10</ins>.<ins style="font-weight: bold; text-decoration: none;">1093/comjnl/32</ins>.<ins style="font-weight: bold; text-decoration: none;">1.90</ins> |title=Semantics and problems of universal quantification in SQL |doi=10.1093/comjnl/32.1.90 |journal=The Computer Journal |date= February 1989|volume=32 |issue=1 |pages=90–91 |access-date=<ins style="font-weight: bold; text-decoration: none;">2024</ins>-<ins style="font-weight: bold; text-decoration: none;">11</ins>-<ins style="font-weight: bold; text-decoration: none;">07</ins>|last1=Negri |first1=M. |last2=Pelagatti |first2=G. |last3=Sbattella |first3=L. |doi-access=free }}</ref><ref name="Fratarcangeli">{{cite journal|url=<ins style="font-weight: bold; text-decoration: none;">https</ins>://<ins style="font-weight: bold; text-decoration: none;">dl</ins>.acm.org/<ins style="font-weight: bold; text-decoration: none;">doi/10</ins>.<ins style="font-weight: bold; text-decoration: none;">1145/</ins>126482.126484 |title=Technique for universal quantification in SQL |doi=10.1145/126482.126484 |journal=ACM SIGMOD Record |year = 1991|access-date=<ins style="font-weight: bold; text-decoration: none;">2024</ins>-<ins style="font-weight: bold; text-decoration: none;">11</ins>-<ins style="font-weight: bold; text-decoration: none;">07</ins>|last1 = Fratarcangeli|first1 = Claudio|volume = 20|issue = 3|pages = 16–24|s2cid=18326990 }}</ref><ref name="kawash">[<ins style="font-weight: bold; text-decoration: none;">https</ins>://www.thefreelibrary.com/Complex+quantification+in+Structured+Query+Language+(SQL):+a+tutorial...-a0119901477 Kawash, Jalal (2004) Complex quantification in Structured Query Language (SQL): a tutorial using relational calculus]; ''Journal of Computers in Mathematics and Science Teaching'' {{ISSN|0731-9258}} Volume 23, Issue 2, 2004 AACE Norfolk, Virginia. Thefreelibrary.com</ref> There is also the {{code|<row value expression> IS DISTINCT FROM <row value expression>}} infixed comparison operator, which returns TRUE unless both operands are equal or both are NULL. Likewise, IS NOT DISTINCT FROM is defined as {{code|NOT (<row value expression> IS DISTINCT FROM <row value expression>)}}. [[SQL:1999]] also introduced {{code|BOOLEAN}} type variables, which according to the standard can also hold Unknown values if it is nullable. In practice, a number of systems (e.g. [[PostgreSQL]]) implement the BOOLEAN Unknown as a BOOLEAN NULL, which the standard says that the NULL BOOLEAN and UNKNOWN "may be used interchangeably to mean exactly the same thing".<ref>{{cite book|author=C. Date|title=SQL and Relational Theory: How to Write Accurate SQL Code|url=https://books.google.com/books?id=Ew06OZtjuJEC&pg=PA83|year=2011|publisher=O'Reilly Media, Inc.|isbn=978-1-4493-1640-2|page=83}}</ref><ref>ISO/IEC 9075-2:2011 §4.5</ref></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Data manipulation ===</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Data manipulation ===</div></td>
</tr>
</table>2600:6C5E:1F00:1489:0:0:0:19F2https://en.wikipedia.org/w/index.php?title=SQL_syntax&diff=1246391409&oldid=prev2402:E280:3E07:1D4:758E:8BFD:9BD5:93D7: /* External links */2024-09-18T17:29:08Z<p><span class="autocomment">External links</span></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 17:29, 18 September 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 604:</td>
<td colspan="2" class="diff-lineno">Line 604:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==External links==</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==External links==</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* {{Citation |url=https://standards.iso.org/iso-iec/9075/-2/ed-6/en/ISO_IEC_9075-2(E)_Foundation.bnf.xml |contribution=Definition of SQL grammar |title=ISO_IEC_9075-2(E)_Foundation.bnf.xml |publisher=ISO Standards Maintenance Portal |format=[[Backus–Naur form]] XML}}.</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* {{Citation |url=https://standards.iso.org/iso-iec/9075/-2/ed-6/en/ISO_IEC_9075-2(E)_Foundation.bnf.xml |contribution=Definition of SQL grammar |title=ISO_IEC_9075-2(E)_Foundation.bnf.xml |publisher=ISO Standards Maintenance Portal |format=[[Backus–Naur form]] XML}}.</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* {{Citation |url=https://quickformatter.com/sql-formatter |contribution=Online SQL Formating Utility |title=Online SQL Formatter Utility}}.</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
</table>2402:E280:3E07:1D4:758E:8BFD:9BD5:93D7https://en.wikipedia.org/w/index.php?title=SQL_syntax&diff=1238995609&oldid=prevOndra.pelech at 19:43, 6 August 20242024-08-06T19:43:01Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 19:43, 6 August 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 599:</td>
<td colspan="2" class="diff-lineno">Line 599:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|n=no|s=no|q=no}}</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|n=no|s=no|q=no}}</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"><</del>References<del style="font-weight: bold; text-decoration: none;">/></del></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">==</ins>References<ins style="font-weight: bold; text-decoration: none;">==</ins></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{Reflist}}</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>==External links==</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* {{Citation |url=https://standards.iso.org/iso-iec/9075/-2/ed-6/en/ISO_IEC_9075-2(E)_Foundation.bnf.xml |contribution=Definition of SQL grammar |title=ISO_IEC_9075-2(E)_Foundation.bnf.xml |publisher=ISO Standards Maintenance Portal |format=[[Backus–Naur form]] XML}}.</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{SQL}}</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{SQL}}</div></td>
</tr>
</table>Ondra.pelechhttps://en.wikipedia.org/w/index.php?title=SQL_syntax&diff=1229373468&oldid=prevNick Levine: Reverted 1 edit by 2406:7400:9A:240C:F111:C481:883A:7049 (talk): Promotional link2024-06-16T12:56:06Z<p>Reverted 1 edit by <a href="/wiki/Special:Contributions/2406:7400:9A:240C:F111:C481:883A:7049" title="Special:Contributions/2406:7400:9A:240C:F111:C481:883A:7049">2406:7400:9A:240C:F111:C481:883A:7049</a> (<a href="/wiki/User_talk:2406:7400:9A:240C:F111:C481:883A:7049" title="User talk:2406:7400:9A:240C:F111:C481:883A:7049">talk</a>): Promotional link</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 12:56, 16 June 2024</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 514:</td>
<td colspan="2" class="diff-lineno">Line 514:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Data types ===</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Data types ===</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Each column in an SQL table declares the type(s) that column may contain. ANSI SQL includes the following data types.<ref name="ISO/IEC">{{cite web |<del style="font-weight: bold; text-decoration: none;">last=Kasiraj</del> <del style="font-weight: bold; text-decoration: none;">|first</del>=<del style="font-weight: bold; text-decoration: none;">Balaji</del> |title=<del style="font-weight: bold; text-decoration: none;">SQL</del> <del style="font-weight: bold; text-decoration: none;">Code</del> <del style="font-weight: bold; text-decoration: none;">beautifier</del> <del style="font-weight: bold; text-decoration: none;">for</del> <del style="font-weight: bold; text-decoration: none;">Analysts</del> <del style="font-weight: bold; text-decoration: none;">and</del> <del style="font-weight: bold; text-decoration: none;">Data</del> <del style="font-weight: bold; text-decoration: none;">Engineers.</del> <del style="font-weight: bold; text-decoration: none;">|url=https</del>:<del style="font-weight: bold; text-decoration: none;">//sqlonline.in/</del> <del style="font-weight: bold; text-decoration: none;">|url-status=live</del> <del style="font-weight: bold; text-decoration: none;">|website=</del>SQL <del style="font-weight: bold; text-decoration: none;">Online</del>}}</ref></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Each column in an SQL table declares the type(s) that column may contain. ANSI SQL includes the following data types.<ref name="ISO/IEC">{{cite web | <ins style="font-weight: bold; text-decoration: none;">url </ins>=<ins style="font-weight: bold; text-decoration: none;"> https://www.iso.org/standard/63555.html</ins> |<ins style="font-weight: bold; text-decoration: none;"> </ins>title<ins style="font-weight: bold; text-decoration: none;"> </ins>= <ins style="font-weight: bold; text-decoration: none;">ISO/IEC</ins> <ins style="font-weight: bold; text-decoration: none;">9075-1:2016:</ins> <ins style="font-weight: bold; text-decoration: none;">Information</ins> <ins style="font-weight: bold; text-decoration: none;">technology&nbsp;–</ins> <ins style="font-weight: bold; text-decoration: none;">Database</ins> <ins style="font-weight: bold; text-decoration: none;">languages&nbsp;–</ins> <ins style="font-weight: bold; text-decoration: none;">SQL&nbsp;–</ins> <ins style="font-weight: bold; text-decoration: none;">Part 1</ins>: <ins style="font-weight: bold; text-decoration: none;">Framework</ins> <ins style="font-weight: bold; text-decoration: none;">(</ins>SQL<ins style="font-weight: bold; text-decoration: none;">/Framework)</ins> }}</ref></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>; Character strings and national character strings</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>; Character strings and national character strings</div></td>
</tr>
<!-- diff cache key enwiki:diff:1.41:old-1229373135:rev-1229373468:wikidiff2=table:1.14.1:ff290eae -->
</table>Nick Levine