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.

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 · SeniorBuild a Kimball Star SchemaData · SeniorReplace LIKE Search With Postgres Full-Text SearchFullstack · SeniorFix the N+1 QueryBackend · MidStop a Double-Charge Race ConditionBackend · MidBuild a Staging-to-Marts dbt ProjectData · MidImplement SCD2 With dbt SnapshotsData · MidImplement the Outbox Pattern (At-Least-Once)Data · MidPlug a Postgres Connection Pool LeakDevOps · MidIndex a Slow Postgres Search QueryDevOps · MidMake an App Wait for Postgres on StartupDevOps · MidMigrate a Postgres Database With Zero DowntimeDevOps · MidWire React to Supabase (CRUD + Realtime)Fullstack · MidRepair Broken API PaginationBackend · JuniorAdd a Health Check Endpoint in GoBackend · JuniorSwitch to Cursor-Based PaginationBackend · JuniorMake an ETL Pipeline IdempotentData · JuniorSpeed Up a Slow SQL Report QueryData · Junior

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.

Build your portfolio free. You are in a real cloud workspace in 30 seconds - fix real systems, show real work.

Start free →