Safekipedia

SQL:1999

Adventurer · ages 7–10Adapted from Wikipedia

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

It added many new features. Some of these features were made clearer later in SQL:2003.

Today, SQL:1999 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 came out later and are also counted as part of SQL:1999. SQL/MED deals with working with data stored outside the database. SQL/OLB covers object language bindings. SQL/JRT explains how to use SQL routines and types with the Java programming language.

New features

SQL:1999 added a Boolean data type. It stores true or false values. Some database systems support it in different ways. IBM Db2 has supported Boolean values since around version 11.1. Microsoft SQL Server uses a "BIT" data type for them. MySQL treats "BOOL" and "BOOLEAN" as another name for its TINYINT(1) type. PostgreSQL has a Boolean type that follows the standard. Oracle Database has had a true Boolean type since Release 23.

SQL:1999 also introduced optional "distinct types." These give an existing basic type a special meaning. They help the database catch mistakes, such as adding an age to a salary by accident. Few SQL systems support them. IBM Db2 is one of them. Oracle database did not support them as of 2012. Instead, it recommended using a one-place structured type.

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. However, SQL:1999 allows only single inheritance. SQL:1999 also added a WITH [RECURSIVE] construct. It lets recursive queries, such as 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. This adds some OLAP abilities. Full RBAC support came through CREATE ROLE. SQL:1999 also introduced the UNNEST keyword.

Quiz time!

4 questions about SQL:1999

Question 1 of 4

Which version of the SQL database query language was SQL:1999?

Keep exploring

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