Search GimmeJob

Type at least 2 characters. Enter also searches by meaning.
GimmeJob
Sign in
Databases, SQL & BI · SQL · Chapter 16 / 17

SQL learning path

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.

Source registry

5 chapter references · Under review
PostgreSQL 18 Tutorial

Primary semantic reference for relational concepts, querying, joins, aggregates, updates, deletes, views, foreign keys, transactions, and window functions.

PostgreSQL Global Development Group · official documentation
Source ↗
PostgreSQL 18 — Queries

Detailed reference for FROM/WHERE/GROUP BY/HAVING, set operations, sorting, LIMIT/OFFSET, CTEs, recursive queries, and query processing.

PostgreSQL Global Development Group · official documentation
Source ↗
SQLite — SELECT

Runtime-aligned reference for SELECT grammar and behavior in the in-browser SQLite practice environment.

SQLite · official documentation
Source ↗
SQLite — Transaction

Runtime-aligned reference for SQLite transaction behavior and explicit transaction control.

SQLite · official documentation
Source ↗
SQL Injection Prevention Cheat Sheet

Security authority for parameterized queries/prepared statements, allow-list validation, and why string-concatenated SQL is unsafe.

OWASP Foundation · security guidance
Source ↗