SQL Fundamentals — Trivia & Interesting Facts¶
Surprising, historical, and little-known facts about SQL.
SQL was invented at IBM in 1970 and was originally called SEQUEL¶
Donald Chamberlin and Raymond Boyce created SEQUEL (Structured English Query Language) at IBM's San Jose Research Laboratory in 1974, based on Edgar Codd's 1970 relational model. The name was changed to SQL because "SEQUEL" was trademarked by the Hawker Siddeley aircraft company. Many people still pronounce SQL as "sequel" because of this origin.
Edgar Codd's 1970 paper was ignored by IBM for nearly a decade¶
Codd published "A Relational Model of Data for Large Shared Data Banks" in June 1970 while at IBM. IBM management was reluctant to implement it because they had already invested heavily in the hierarchical IMS database. It took Larry Ellison, who read the paper, to build the first commercial implementation — Oracle — in 1979, forcing IBM to rush out SQL/DS and DB2.
NULL in SQL does not equal NULL¶
One of SQL's most confusing behaviors is that NULL = NULL evaluates to NULL (not TRUE). This three-valued logic (TRUE, FALSE, NULL) was adopted from the relational model and means you must use IS NULL instead of = NULL. This has been a source of bugs for over 40 years and is probably the single most common SQL mistake made by beginners.
The SQL standard is over 4,000 pages long¶
The full SQL standard (ISO/IEC 9075) spans over 4,000 pages across 11 parts. No database fully implements the entire standard, and every major database has proprietary extensions. The standard is also extremely expensive to purchase — around $300 for the complete set from ISO. This has led to the joke that the SQL "standard" is more of a "suggestion."
SELECT is the most complicated SQL statement by far¶
While SELECT appears simple, the full syntax includes FROM, WHERE, GROUP BY, HAVING, WINDOW, ORDER BY, LIMIT/OFFSET, CTEs (WITH), subqueries, lateral joins, and set operations (UNION, INTERSECT, EXCEPT). The logical execution order differs from the written order — FROM is evaluated first, then WHERE, then GROUP BY, and SELECT is near the end, which is counterintuitive for beginners.
SQL was almost replaced by object databases in the 1990s¶
During the 1990s, object-oriented databases (OODBMS) like ObjectStore, Versant, and O2 were predicted to replace SQL databases. Major analysts predicted that relational databases would be obsolete by 2000. Instead, relational databases adopted some object features (user-defined types, inheritance) and remained dominant. The OODBMS market peaked around 1997 and largely disappeared.
The JOIN keyword was not in the original SQL standard¶
Early SQL implementations used comma-separated tables in the FROM clause with WHERE conditions for joins. The explicit JOIN syntax (INNER JOIN, LEFT JOIN, etc.) was not standardized until SQL-92. Even today, some DBAs still write implicit joins using the comma syntax, though explicit JOINs are considered best practice for clarity.
A single SQL query can replace hundreds of lines of procedural code¶
The set-based nature of SQL means operations that would require nested loops in procedural languages can often be expressed in a single statement. A famous example is calculating a running total: what requires an explicit loop in Python or Java can be done with a single SUM() OVER (ORDER BY ...) window function in SQL.
Window functions took 30 years to become widely available¶
Window functions (OVER, PARTITION BY, ROW_NUMBER, RANK) were standardized in SQL:2003 but took years to be implemented across databases. MySQL did not support window functions until version 8.0 (2018), 15 years after the standard. These functions are now considered essential for analytical queries and have eliminated many previously complex subquery patterns.
The most expensive SQL mistake is probably a missing WHERE clause on a DELETE or UPDATE¶
Every experienced DBA has a horror story about running DELETE FROM users or UPDATE accounts SET balance = 0 without a WHERE clause. This is why production database access typically requires peer review, why point-in-time recovery exists, and why many teams enforce read-only access for all but designated administrators.