GimmeJob
Sign in
Databases, SQL & BI · SQL · Chapter 16 / 17

SQL learning path

SQL dialects & production habits

Finishing a SQL tutorial does not mean every query is portable or production-safe. Real work adds 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.

Do not “learn around” these differences by memorizing every vendor. Learn the relational operation first, then look up the concrete syntax.

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.

Choosing a practice engine

SQLite is ideal for this site's zero-install browser exercises and teaches a large portion of relational SQL. PostgreSQL is a strong next step for server-side practice because it exposes rich types, constraints, transactions, query plans, window functions, CTEs, JSON, roles, and production-grade concurrency behavior.

What “done” looks like

You should be able to solve a new data problem without searching for a copied query: define the desired grain, identify relations and keys, choose filters/joins/grouping/windows, predict NULL and duplicate behavior, produce deterministic results, and validate performance/security assumptions against the target engine.

Capstone: write a small investigation using at least one join, one aggregate or window function, one CTE, and one integrity assertion. Explain the result grain and why your query is safe against duplicates and NULL surprises.

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 ↗