Question bank

SQL interview questions

12 SQL interview questions, each with a scenario, an interview-ready answer, a detailed explanation, tested code with real output, production notes and common mistakes.

Window functions

Gaps and islands

Deduplication

Ranking

Joins

NULL handling

Query optimisation

Prefer one long read? The SQL Interview Questions guide covers SQL traps topic by topic.