Jump to content
Wikipedia The Free Encyclopedia

SQL:1999

From Wikipedia, the free encyclopedia
1999 edition of the SQL standard
SQL language revisions

SQL:1999 (also called SQL 3) was the fourth revision of the SQL database query language. It introduced many new features, many of which required clarifications in the subsequent SQL:2003. In the meanwhile[clarification needed ] SQL:1999 is deprecated.

Summary

[edit ]

The ISO standard documents were published between 1999 and 2002 in several installments, the first one consisting of multiple parts. Unlike previous editions, the standard's name used a colon instead of a hyphen for consistency with the names of other ISO standards. The first installment of SQL:1999 had five parts:

Three more parts, also considered part of SQL:1999 were published subsequently:

New features

[edit ]

Data types

[edit ]

Boolean data types

[edit ]

The SQL:1999 standard calls for a Boolean type,.[1] IBM Db2 supports boolean values since around 11.1.[2] Microsoft SQL Server supports storage for booleans using "BIT" data type[citation needed ]. MySQL interprets "BOOL" and "BOOLEAN" as a mapping for its native TINYINT(1) type.[3] PostgreSQL provides a standard conforming Boolean type.[4] Oracle Database has proper boolean since Release 23.[5]

Distinct user-defined types of power

[edit ]

Sometimes called just distinct types, these were introduced as an optional feature (S011) to allow existing atomic types to be extended with a distinctive meaning to create a new type and thereby enabling the type checking mechanism to detect some logical errors, e.g. accidentally adding an age to a salary. For example:

createtypeageasintegerFINAL;
createtypesalaryasintegerFINAL;

creates two different and incompatible types. The SQL distinct types use name equivalence not structural equivalence like typedefs in C. It's still possible to perform compatible operations on (columns or data) of distinct types by using an explicit type CAST.

Few SQL systems support these. IBM Db2 is one those supporting them.[6] Oracle database did not support them as of 2012, recommending instead to emulate them by a one-place structured type.[7]

Structured user-defined types

[edit ]
Main article: Structured type

These are the backbone of the object–relational database extension in SQL:1999. They are analogous to classes in objected-oriented programming languages. SQL:1999 allows only single inheritance.

Common table expressions and recursive queries

[edit ]

SQL:1999 added a WITH [RECURSIVE] construct allowing recursive queries, like transitive closure, to be specified in the query language itself; see common table expressions.

Some OLAP capabilities

[edit ]

GROUP BY was extended with ROLLUP, CUBE, and GROUPING SETS.

Role-based access control

[edit ]

Full support for RBAC via CREATE ROLE.

Keywords

[edit ]

SQL:1999 introduced the UNNEST keyword.[8]

References

[edit ]
  1. ^ ISO/IEC 9075-2:1999 Archived 2016年12月24日 at the Wayback Machine section 4.6 Boolean types
  2. ^ https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.wn.doc/doc/c0061179.html#c0061179__FP1 [permanent dead link ]
  3. ^ "MySQL :: MySQL 5.0 Reference Manual :: 11.4 Using Data Types from Other Database Engines". Dev.mysql.com. 2010年01月09日. Archived from the original on 2014年02月07日. Retrieved 2014年01月30日.
  4. ^ "PostgreSQL documentation about Boolean Type". Archived from the original on 2018年03月09日. Retrieved 2023年12月06日.
  5. ^ "Data Types". docs.oracle.com. Retrieved 2025年08月22日.
  6. ^ "IBM Information Management Software for z/OS Solutions Information Center". Publib.boulder.ibm.com. Retrieved 2014年01月30日.
  7. ^ "Oracle Compliance To Core SQL:2003". Docs.oracle.com. Archived from the original on 2013年12月02日. Retrieved 2014年01月30日.
  8. ^ Jones, Arie; Stephens, Ryan K.; Plew, Ronald R.; Garrett, Robert F.; Kriegel, Alex (2005). "Appendix B ANSI and Vendor Keywords". SQL Functions Programmer's Reference. John Wiley & Sons. p. 680. ISBN 9780764598074 . Retrieved 2016年05月16日.

Further reading

[edit ]

AltStyle によって変換されたページ (->オリジナル) /