SQL
SQL (Structured Query Language) is the declarative language for defining, querying, and manipulating relational databases. Despite decades of speculation about its replacement, SQL remains the dominant data interface across analytics, transactional systems, and increasingly across distributed and embedded databases.
Statement categories
- DDL (Data Definition Language):
CREATE,ALTER,DROPfor schemas, tables, indexes - DML (Data Manipulation Language):
SELECT,INSERT,UPDATE,DELETE - DCL (Data Control Language):
GRANT,REVOKEfor permissions - TCL (Transaction Control Language):
BEGIN,COMMIT,ROLLBACK,SAVEPOINT
SQL dialects
The SQL standard is large; every database implements a subset and adds its own extensions. The differences matter most around: data types, window functions, recursive CTEs, JSON support, upsert syntax, and array handling.
- PostgreSQL. The closest mainstream implementation to the standard, with rich extensions.
- MySQL. Widely deployed; more permissive defaults; InnoDB engine.
- SQLite. Embedded; surprising amount of SQL coverage; default for many applications.
- SQL Server, Oracle. Enterprise heavyweights with proprietary extensions (T-SQL, PL/SQL).
- Distributed SQL. CockroachDB, Spanner, TiDB, YugabyteDB run SQL across horizontally scaled clusters.
📖
Further Reading
The Cost of SQL Habits on MongoDB Infrastructure
The Cost of SQL Habits on MongoDB Infrastructure