Overview

Structured Query Language (SQL) is an evolving spec. The minimum standard a system needs to support to claim it is a SQL database is SQL-92.

SQL is based on bags (unordered set with duplicates) instead of sets (unordered set).

SQL essentially provides:

(Modern) SQL features

The example DB uses have 3 relations:

Aggregates

functions that return a single value from a bag of tuples:

Group by

Project tuples into subsets and calculate aggregates against each subset

Example: