SQL-Engineering-Handbook

Module 18 — SQL Interview Questions # Module 18 · SQL Interview Questions **A structured SQL assessment system: 92 questions across 10 competency levels, built for candidates, interviewers and hiring managers.** [![Questions](https://img.shields.io/badge/questions-92-blue?style=for-the-badge)](#-current-coverage) [![Levels](https://img.shields.io/badge/levels-10%20(0%E2%80%939)-orange?style=for-the-badge)](#-competency-levels) [![Target](https://img.shields.io/badge/target-~490-lightgrey?style=for-the-badge)](#-current-coverage) [![License](https://img.shields.io/badge/license-MIT-brightgreen?style=for-the-badge)](#-contributing) [Taxonomy](/SQL-Engineering-Handbook/18_SQL_INTERVIEW_QUESTIONS/TAXONOMY_AND_FORMAT.html) · [Question Index](/SQL-Engineering-Handbook/18_SQL_INTERVIEW_QUESTIONS/QUESTION_INDEX.html) · [Practice Tracks](/SQL-Engineering-Handbook/18_SQL_INTERVIEW_QUESTIONS/PRACTICE_TRACKS.html) · [Interviewer Guide](/SQL-Engineering-Handbook/18_SQL_INTERVIEW_QUESTIONS/INTERVIEWER_GUIDE.html) · [Scoring Rubric](/SQL-Engineering-Handbook/18_SQL_INTERVIEW_QUESTIONS/SCORING_RUBRIC.html) · [Handbook Home](/SQL-Engineering-Handbook/)

📑 Table of Contents


🎯 What This Module Is

A structured SQL assessment system, not a list of trivia. It serves two audiences at once: people preparing for SQL interviews and people running them. Every question tests whether someone can apply SQL engineering judgment, not whether they’ve memorized syntax.

[!IMPORTANT] This module does not re-teach SQL. It assumes, and cross-links to, the handbook’s core curriculum (01_Fundamentals through 17_TRANSACTIONS_AND_CONCURRENCY). If a question’s underlying concept is unfamiliar, follow its Related Modules link and learn it there first.


👥 Who Should Use This

You are a… Start here What you get
🧑‍💻 Candidate PRACTICE_TRACKS.md Pre-built question sequences by role and length
🎤 Interviewer INTERVIEWER_GUIDE.md Interview methodology, not just a question list
🧭 Hiring manager SCORING_RUBRIC.md An eight-dimension competency scoring model
🛠️ Engineer self-assessing FAQ.md Guidance on honest self-scoring
flowchart LR
    T["TAXONOMY_AND_FORMAT<br/>learn the schema"] --> I["QUESTION_INDEX<br/>filter by level, difficulty, type"]
    I --> P["PRACTICE_TRACKS<br/>candidates"]
    I --> G["INTERVIEWER_GUIDE<br/>interviewers"]
    G --> S["SCORING_RUBRIC<br/>hiring managers"]
    P --> C["INTERVIEW_CHEATSHEET<br/>final recall"]

🪜 Competency Levels

Ten levels, numbered 0–9. Each level assumes the ones below it. Every level folder contains a QUESTION_BANK.md.

Level Name Question bank
0 Foundations 01_FOUNDATIONS
1 Core SQL 02_CORE_SQL
2 Analytical SQL 03_ANALYTICAL_SQL
3 Advanced SQL 04_ADVANCED_SQL
4 Database Engineering 05_DATABASE_ENGINEERING
5 Real-World SQL 06_REAL_WORLD_SQL
6 Production Debugging 07_PRODUCTION_DEBUGGING
7 Senior / Staff Engineering 08_SENIOR_ENGINEERING
8 Interviewer / Hiring 09_INTERVIEWER_QUESTIONS
9 SQL System Design 10_SQL_SYSTEM_DESIGN
Competency pyramid: all 10 levels
All 10 levels (L0–L9), all built

📊 Current Coverage

92 questions, built across all 10 competency levels. This is the third expansion pass beyond the original 48-question breadth pilot, targeted at Levels 1–2 (the largest remaining gap to the ~490 target). No new levels were added.

Level Name Built Target Progress
0 Foundations 10 ~40 ▰▰▰▰▰▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱ 25%
1 Core SQL 16 ~60 ▰▰▰▰▰▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱ 27%
2 Analytical SQL 17 ~80 ▰▰▰▰▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱ 21%
3 Advanced SQL 9 ~70 ▰▰▰▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱ 13%
4 Database Engineering 8 ~70 ▰▰▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱ 11%
5 Real-World SQL 8 ~70 ▰▰▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱ 11%
6 Production Debugging 6 ~40 ▰▰▰▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱ 15%
7 Senior / Staff Engineering 6 ~40 ▰▰▰▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱ 15%
8 Interviewer / Hiring 6 ~30 ▰▰▰▰▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱ 20%
9 SQL System Design 6 ~30 ▰▰▰▰▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱ 20%
  Total 92 ~490 ▰▰▰▰▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱▱ 19%

What each question contains

Optional fields are omitted where they would add little value, not padded in for uniformity.

Element Coverage
### Explanation or ### Expected Answer 66 of 92 questions
### Interviewer Follow-Up 86 of 92 questions
Explicit ### Common Mistake (or Level 8’s Weak Answer) About 10 of 92 carry the literal heading
Named “senior-level extension” A handful. Levels 7–9 serve as the extension by design.
Explicit Related Modules link 26 of 92 questions
Format notes and known gaps (read before auditing) - Scenario-style and interviewer-facing questions (for example Levels 6 and 8) use their own section structure instead of the exact headings above. - **Q041–Q044, Q077 and Q078** have no separate follow-up section. - On most questions the common-mistake framing is folded into the explanation prose instead of being broken out as its own section. **Retrofitting a dedicated section onto every question is a real coverage gap, not yet done.** It is tracked in [`AUDIT_REPORT.md`](/SQL-Engineering-Handbook/18_SQL_INTERVIEW_QUESTIONS/AUDIT_REPORT.html) rather than silently claimed here. - The Level 7–9 questions act as the senior-level extension (harder variants of the same skills), rather than each L0–L6 question carrying its own bolt-on senior section. See also [`FINAL_VALIDATION_REPORT.md`](/SQL-Engineering-Handbook/18_SQL_INTERVIEW_QUESTIONS/FINAL_VALIDATION_REPORT.html).

🧩 How the Question Bank Is Organized

Full schema: TAXONOMY_AND_FORMAT.md. In short:

Dimension Values
Competency levels 10, numbered 0–9, each assuming the ones below it
Difficulty ratings 5, assigned by objective criteria: 🟢 🟡 🟠 🔴 ⚫
Question types 10: Write SQL · Predict Output · Debug · Optimize · Explain · Compare · Data Reasoning · Execution Plan · Design · Production Incident

Use QUESTION_INDEX.md to filter every question by level, difficulty and type.


🧭 Navigation

File Purpose
TAXONOMY_AND_FORMAT.md The schema. Read this first.
QUESTION_INDEX.md Every question, filterable by level, difficulty and type
INTERVIEWER_GUIDE.md How to actually run an interview with this bank
SCORING_RUBRIC.md Eight-dimension competency scoring model
INTERVIEW_CHEATSHEET.md Compact recall reference
PRACTICE_TRACKS.md Pre-built question sequences by role and length
GLOSSARY.md Terms used throughout, linked to full explanations
FAQ.md Practical usage questions
AUDIT_REPORT.md Tracked coverage gaps and audit findings
FINAL_VALIDATION_REPORT.md Validation results
scripts/validate_questions.py Structural validation script

Competency pyramid
Competency pyramid
All 10 levels (L0–L9), all built · source
Interview flow
Interview flow
Assessment workflow, track selection to scoring · source

🗃️ Dataset Approach


About a third of questions (26 of 92) carry an explicit Related Modules link to the one curriculum lesson they draw on. The rest lack a clean single link, not a connection:


🗂️ Repository Layout

18_SQL_INTERVIEW_QUESTIONS/
├── README.md
├── TAXONOMY_AND_FORMAT.md
├── QUESTION_INDEX.md
├── INTERVIEWER_GUIDE.md
├── SCORING_RUBRIC.md
├── INTERVIEW_CHEATSHEET.md
├── PRACTICE_TRACKS.md
├── GLOSSARY.md
├── FAQ.md
├── AUDIT_REPORT.md
├── FINAL_VALIDATION_REPORT.md
├── 01_FOUNDATIONS/            └─ QUESTION_BANK.md
├── 02_CORE_SQL/               └─ QUESTION_BANK.md
├── 03_ANALYTICAL_SQL/         └─ QUESTION_BANK.md
├── 04_ADVANCED_SQL/           └─ QUESTION_BANK.md
├── 05_DATABASE_ENGINEERING/   └─ QUESTION_BANK.md
├── 06_REAL_WORLD_SQL/         └─ QUESTION_BANK.md
├── 07_PRODUCTION_DEBUGGING/   └─ QUESTION_BANK.md
├── 08_SENIOR_ENGINEERING/     └─ QUESTION_BANK.md
├── 09_INTERVIEWER_QUESTIONS/  └─ QUESTION_BANK.md
├── 10_SQL_SYSTEM_DESIGN/      └─ QUESTION_BANK.md
├── scripts/
│   └── validate_questions.py
└── assets/
    ├── images/hero.svg
    └── diagrams/
        ├── competency-pyramid.svg
        └── interview-flow.svg

✅ Validation

Run from this module’s root:

python3 scripts/validate_questions.py .

It checks duplicate IDs, missing required fields and broken relative links. See the script’s docstring for documented limitations.


🤝 Contributing

  1. Follow the format and deduplication policy in TAXONOMY_AND_FORMAT.md.
  2. Assign the next sequential Q### ID.
  3. Run scripts/validate_questions.py before submitting.

Released under the MIT license.


🧭 Module Navigation

[⬅️ **Previous:** 17 — Transactions & Concurrency](/SQL-Engineering-Handbook/17_TRANSACTIONS_AND_CONCURRENCY/)  |  [🏠 **SQL Engineering Handbook**](/SQL-Engineering-Handbook/) Part of the SQL Engineering Handbook · Module 18 of the series