ArticleslgStudy

science

SQL:1999

SQL:1999 is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand SQL:1999 rather than just read about it. In short: 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.

Key takeaways

  • SQL:1999 belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect SQL:1999 to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of SQL:1999 from memory before moving on to harder problems.

Reference excerpt

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 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 standards. The first installment of SQL:1999 had five parts:

SQL/Framework ISO/IEC 9075-1:1999 SQL/Foundation ISO/IEC 9075-2:1999 SQL/CLI : an updated definition of the extension Call Level Interface, originally published in 1995, also known as CLI-95 ISO/IEC 9075-3:1999 SQL/PSM : an updated definition of the extension Persistent Stored Modules, originally published in 1996, also known as PSM-96 ISO/IEC 9075-4:1999 SQL/Bindings 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 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 supports storage for Booleans using "BIT" data type. MySQL interprets "BOOL" and "BOOLEAN" as a mapping for its native TINYINT(1) type. PostgreSQL provides a standard conforming Boolean type. Oracle Database 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:

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. Oracle database did not support them as of 2012, recommending instead to emulate them by a one-place structured type.

Structured user-defined types

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 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 GROUP BY was extended with ROLLUP, CUBE, and GROUPING SETS.

Role-based access control Full support for RBAC via CREATE ROLE.

Keywords SQL:1999 introduced the UNNEST keyword.

References

Further reading Jim Melton; Alan R. Simon (2002). SQL:1999: Understanding Relational Language Components. Morgan Kaufmann. ISBN 978-1-55860-456-8. Jim Melton (2003). Advanced SQL, 1999: Understanding Object–Relational and Other Advanced Features. Morgan Kaufmann. ISBN 978-1-55860-677-7.

Worked examples

Example 1 — a first encounter with SQL:1999

Start with the simplest possible case. Write down what SQL:1999 claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to SQL:1999 before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about SQL:1999 ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of SQL:1999

In research
SQL:1999 appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses SQL:1999 in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
SQL:1999 is common in secondary-school and first-year university syllabi. It links to neighbouring topics Declarative programming languages, SQL, so understanding it makes those chapters shorter.
In everyday life
Look for SQL:1999 outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “SQL:1999” →

How to study SQL:1999 in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what SQL:1999 means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain SQL:1999 out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is SQL:1999 in simple terms?

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.

Why does SQL:1999 matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study SQL:1999?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on SQL:1999.

Tags

  • Declarative programming languages
  • SQL

Keep exploring