SQL dialects & production habits
Production SQL involves dialect differences, large data volumes, concurrent transactions, permissions, migrations, monitoring and failure recovery.
Common dialect differences to expect
Check target-engine documentation for:
- LIMIT/OFFSET versus TOP/OFFSET-FETCH pagination,
- identity/auto-increment/sequence syntax,
- date/time functions and timezone handling,
- string concatenation and case-insensitive matching,
- boolean types,
- JSON/array operators,
- UPSERT/MERGE syntax,
- RETURNING/OUTPUT clauses,
- stored procedures/functions/triggers,
- locking hints and isolation behavior.
Relational operations can be shared across engines while their concrete syntax, types and transaction behavior differ.
Transactions and isolation in production
Atomicity is only one transaction property. Isolation determines which concurrent effects a transaction may observe. Terms such as read committed, repeatable read, serializable, snapshots, locks, deadlocks, and write conflicts matter when multiple requests modify related state.
A test that passes in a single-threaded local database may still fail under production concurrency.
Migrations are deployment work
Schema migrations need compatibility planning. Common safe patterns include additive changes first, application rollout second, backfill in bounded batches, validation, and only then removal of old columns/constraints. Large index creation or table rewrites can lock or load production systems.
Query observability
Production database work should expose slow-query information, lock/deadlock metrics, connection-pool saturation, replication lag where applicable, storage growth, and query-plan regressions. A “fast on my laptop” query is not performance evidence.
Review SQL as code
Important SQL deserves the same review standards as application code:
- intent and expected grain documented,
- parameters instead of concatenated input,
- bounded writes,
- explicit deterministic ordering where required,
- edge cases for NULL and duplicates,
- execution plan checked for expensive queries,
- migration/rollback strategy for schema changes,
- representative tests.
Browser and server engines
The site's browser examples run on isolated SQLite databases. PostgreSQL, MySQL and SQL Server have their own type systems, constraints, transaction behavior and query planners, so SQLite execution alone does not establish compatibility with those engines.
Query correctness
A correct query has a defined result grain, matching relationship keys, intentional NULL and duplicate handling, and deterministic ordering when the result requires it. A plausible row count alone does not establish that the selected rows or aggregate values are correct.