SQL Interview Questions (Practice on a Real Database)

SQL interviews test whether you can actually query and reason about data. These are real SQL problems against a real database - aggregations, window functions, a slow report to tune, a wrong join to fix - solved in a live cloud workspace.

Get started - freeLive cloud workspace in your browser · nothing to install

Why a real database beats flashcards

Anyone can recite the join types; the interview wants to see you write the query and explain why it is slow. Practicing against a real database with real data builds that, and window functions and query tuning are the parts that separate strong candidates.

18 real scenarios to practice

Add a NOT NULL Column With a Zero-Downtime BackfillBackend · SeniorRoute Reads to a Postgres ReplicaBackend · SeniorBuild a Kimball Star SchemaData · SeniorBackfill a Column Safely (Batched + Verified)Data · SeniorHandle Late-Arriving Data in an Incremental LoadData · SeniorBuild an Event-Sourced Projection (CQRS)Data · SeniorReplace LIKE Search With Postgres Full-Text SearchFullstack · SeniorPlug a Postgres Connection Pool LeakBackend · MidFix the N+1 QueryBackend · MidStop a Double-Charge Race ConditionBackend · MidFix a Pipeline Silently Dropping RecordsData · MidOptimize Batch Insert Throughput (COPY)Data · MidBuild a Staging-to-Marts dbt ProjectData · MidImplement SCD2 With dbt SnapshotsData · MidChoose the Right Postgres Join AlgorithmData · MidImplement the Outbox Pattern (At-Least-Once)Data · MidDebug a DuckDB Join That Multiplies RowsData · MidPlug a Postgres Connection Pool LeakDevOps · Mid

What SQL interviews focus on

Joins and aggregation, window functions, and reading an EXPLAIN to fix a slow query. Each problem here is one of those on real data, so you can speak to trade-offs from experience.

Do real production work, free. Live cloud workspaces in your browser - every project you complete lands on your portfolio.

Get started - free
Get started - free