Live site (GitHub Pages): https://santoshkhatri9860.github.io/advanced-sql-practice-mysql/
Exercise Index: https://github.com/santoshkhatri9860/advanced-sql-practice-mysql/blob/main/exercises/README.md
Quickstart (setup + smoke test): https://github.com/santoshkhatri9860/advanced-sql-practice-mysql/blob/main/docs/QUICKSTART.md
A practice-first SQL workbook with 1,400+ topic-wise questions — from fundamentals to advanced patterns — built for job prep, interviews, and real-world SQL fluency.
Most sites explain advanced SQL concepts, but don’t provide enough structured, high-volume practice. This repo is designed to fix that: prompts first, then separate solutions so you can practice properly and verify fast.
Best for: learners • job seekers • interview prep • anyone leveling up SQL
- Subqueries +
EXISTS - Correlated subqueries
- Window functions (aggregate, ranking, frames)
LAG()/LEAD()- CTEs (non-recursive + multi-CTE)
- Recursive CTEs (numbers + employee hierarchy)
- Date/Time functions
exercises/→ prompts-only (try first)solutions/→ complete solutions (reference after)db/→ local DB setup + seed scriptsdocker-compose.yml→ optional local MySQL setupdocs/→ how to use + roadmap + style guidearchive/→ original work preserved without changes
- Read:
docs/HOW_TO_USE.md - Start practicing:
exercises/README.md - Check your work:
solutions/
Want a local database with sample data? See
db/(Docker is optional).
- Subqueries
- EXISTS + correlated subqueries
- Window functions (ROW_NUMBER, RANK/DENSE_RANK)
- Window frames
- LAG/LEAD
- CTEs
- Recursive CTEs
- Date/Time patterns
- Beginners who know basic SQL and want to level up with real practice
- Data analysts preparing for SQL interviews
- Anyone who wants a structured workbook instead of random questions
- MySQL 8+ recommended (for CTEs + window functions).
- SQL often has multiple correct answers — solutions are reference implementations.
If this repo helps you practice SQL, consider starring it ⭐ — it helps more learners discover it.