SQL 3
   HOME

TheInfoList



OR:

SQL:1999 (also called SQL 3) was the fourth revision of the
SQL Structured Query Language (SQL) (pronounced ''S-Q-L''; or alternatively as "sequel") is a domain-specific language used to manage data, especially in a relational database management system (RDBMS). It is particularly useful in handling s ...
database In computing, a database is an organized collection of data or a type of data store based on the use of a database management system (DBMS), the software that interacts with end users, applications, and the database itself to capture and a ...
query language A query language, also known as data query language or database query language (DQL), is a computer language used to make queries in databases and information systems. In database systems, query languages rely on strict theory to retrieve informa ...
. It introduced many new features, many of which required clarifications in the subsequent SQL:2003. In the meanwhile SQL:1999 is deprecated.


Summary

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 The International Organization for Standardization (ISO ; ; ) is an independent, non-governmental, international standard development organization composed of representatives from the national standards organizations of member countries. Me ...
standards. The first installment of SQL:1999 had five parts: * SQL/Frameworkbr>ISO/IEC 9075-1:1999
* SQL/Foundationbr>ISO/IEC 9075-2:1999
*
SQL/CLI The Call Level Interface (CLI or SQL/CLI) is an application programming interface (API) and software standard to embed Structured Query Language (SQL) code in a host program as defined in a joint standard by the International Organization for Stand ...
: an updated definition of the extension Call Level Interface, originally published in 1995, also known as CLI-9
ISO/IEC 9075-3:1999
*
SQL/PSM SQL/PSM (SQL/Persistent Stored Modules) is an ISO standard mainly defining an extension of SQL with a procedural language for use in stored procedures. Initially published in 1996 as an extension of SQL-92 (ISO/IEC 9075-4:1996, a version sometimes ...
: an updated definition of the extension Persistent Stored Modules, originally published in 1996, also known as PSM-9
ISO/IEC 9075-4:1999
* SQL/Bindingsbr>ISO/IEC 9075-5:1999
Three more parts, also considered part of SQL:1999 were published subsequently: * SQL/MED Management of External Data (SQL:1999 part 9
ISO/IEC 9075-9:2001
*
SQL/OLB SQL/OLB, or ''Object Language Bindings'', is a standard for embedding SQL in Java, commonly known by its prior name as SQLJ (part 0). Besides describing the syntax and semantics of SQLJ, which are typically given relative to JDBC, the standard also ...
Object Language Bindings (SQL:1999 part 10
ISO/IEC 9075-10:2000
* SQL/JRT SQL Routines and Types using the Java Programming Language (SQL:1999 part 13
ISO/IEC 9075-13:2002


New features


Data types


Boolean data types

The SQL:1999 standard calls for a Boolean type,. IBM Db2 supports boolean values since around 11.1.
Microsoft SQL Server Microsoft SQL Server is a proprietary relational database management system developed by Microsoft using Structured Query Language (SQL, often pronounced "sequel"). As a database server, it is a software product with the primary function of ...
supports storage for booleans using "BIT" data type.
MySQL MySQL () is an Open-source software, open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the acronym for Structured Query Language. A rel ...
interprets "BOOL" and "BOOLEAN" as a mapping for its native TINYINT(1) type.
PostgreSQL PostgreSQL ( ) also known as Postgres, is a free and open-source software, free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance. PostgreSQL features transaction processing, transactions ...
provides a standard conforming Boolean type.
Oracle Database Oracle Database (commonly referred to as Oracle DBMS, Oracle Autonomous Database, or simply as Oracle) is a proprietary multi-model database management system produced and marketed by Oracle Corporation. It is a database commonly used for ru ...
has proper boolean since Release 23.


Distinct user-defined types of power

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: create type age as integer FINAL; create type salary as integer FINAL; creates two different and incompatible types. The SQL distinct types use name equivalence not
structural equivalence Similarity in network analysis occurs when two nodes (or other more elaborate structures) fall in the same equivalence class. There are three fundamental approaches to constructing measures of network similarity: structural equivalence, automor ...
like
typedef typedef is a reserved keyword in the programming languages C, C++, and Objective-C. It is used to create an additional name (''alias'') for another data type, but does not create a new type, except in the obscure case of a qualified typedef of ...
s 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.
Oracle database Oracle Database (commonly referred to as Oracle DBMS, Oracle Autonomous Database, or simply as Oracle) is a proprietary multi-model database management system produced and marketed by Oracle Corporation. It is a database commonly used for ru ...
did not support them as of 2012, recommending instead to emulate them by a one-place
structured type The SQL:1999 standard introduced a number of object–relational database features into SQL, chiefly among them structured user-defined types, usually called just structured types. These can be defined either in plain SQL with CREATE TYPE but also ...
.


Structured user-defined types

These are the backbone of the
object–relational database An object–relational database (ORD), or object–relational database management system (ORDBMS), is a database management system (DBMS) similar to a relational database, but with an object-oriented database model: objects, classes and inherit ...
extension in SQL:1999. They are analogous to
class Class, Classes, or The Class may refer to: Common uses not otherwise categorized * Class (biology), a taxonomic rank * Class (knowledge representation), a collection of individuals or objects * Class (philosophy), an analytical concept used d ...
es in objected-oriented programming languages. SQL:1999 allows only
single inheritance Multiple inheritance is a feature of some object-oriented computer programming languages in which an object or class can inherit features from more than one parent object or parent class. It is distinct from single inheritance, where an object o ...
.


Common table expressions and recursive queries

SQL:1999 added a WITH ECURSIVEconstruct allowing recursive queries, like
transitive closure In mathematics, the transitive closure of a homogeneous binary relation on a set (mathematics), set is the smallest Relation (mathematics), relation on that contains and is Transitive relation, transitive. For finite sets, "smallest" can be ...
, to be specified in the query language itself; see
common table expressions Common may refer to: As an Irish surname, it is anglicised from Irish Gaelic surname Ó Comáin. Places * Common, a townland in County Tyrone, Northern Ireland * Boston Common, a central public park in Boston, Massachusetts * Cambridge Common, ...
.


Some

OLAP In computing, online analytical processing (OLAP) (), is an approach to quickly answer multi-dimensional analytical (MDA) queries. The term ''OLAP'' was created as a slight modification of the traditional database term online transaction processi ...
capabilities

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


Role-based access control

Full support for
RBAC In computer systems security, role-based access control (RBAC) or role-based security is an approach to restricting system access to authorized users, and to implementing mandatory access control (MAC) or discretionary access control (DAC). Ro ...
via CREATE ROLE.


Keywords

SQL:1999 introduced the UNNEST keyword.


References


Further reading

* * {{SQL * Declarative programming languages