Safekipedia

SQL:1999

Discoverer · ages 10+Adapted from Wikipedia

SQL:1999, also called SQL 3, was the fourth revision of the SQL database query language. A query language is a way of asking a database for information.

It introduced many new features. Many of these features needed clarifying in the later SQL:2003.

Today, SQL:1999 is deprecated, which means it is no longer recommended for use.

Summary

The official standard documents for SQL:1999 were published between 1999 and 2002, in several parts. Unlike earlier editions, its name used a colon instead of a hyphen, to match the names of other ISO standards. The first group had five parts: SQL/Framework, SQL/Foundation, SQL/CLI, which updated the Call Level Interface first published in 1995, SQL/PSM, which updated the Persistent Stored Modules first published in 1996, and SQL/Bindings.

Three more parts were published later and are also considered part of SQL:1999: SQL/MED for managing external data, SQL/OLB for object language bindings, and SQL/JRT, which covers SQL routines and types using the Java programming language.

New features

The SQL:1999 standard added a Boolean data type, which stores true or false values. Several database systems support it in different ways. IBM Db2 supports Boolean values since around 11.1, and Microsoft SQL Server stores Booleans using a "BIT" data type. MySQL treats "BOOL" and "BOOLEAN" as another name for its TINYINT(1) type, and PostgreSQL provides a Boolean type that follows the standard. Oracle Database has a proper Boolean type since Release 23. SQL:1999 also introduced optional "distinct types," which give an existing basic type a special meaning. This helps the database catch mistakes, such as accidentally adding an age to a salary. Few SQL systems support them. IBM Db2 is one of them, while Oracle database did not support them as of 2012 and recommended using a one-place structured type instead.

Main article: Structured type

Structured user-defined types are the main part of the object–relational database extension in SQL:1999. They work somewhat like classes in objected-oriented programming languages, but SQL:1999 allows only single inheritance. SQL:1999 also added a WITH [RECURSIVE] construct, which lets recursive queries, like transitive closure, be written in the query language itself. These are explained in common table expressions. The standard also extended GROUP BY with ROLLUP, CUBE, and GROUPING SETS, adding some OLAP capabilities. Full RBAC support came through CREATE ROLE, and SQL:1999 introduced the UNNEST keyword.

Quiz time!

5 questions about SQL:1999

Question 1 of 5

What does it mean when a standard is "deprecated"?

Keep exploring

This article is a child-friendly adaptation of the Wikipedia article on SQL:1999, available under CC BY-SA 4.0.