Skip to content

santoshkhatri9860/advanced-sql-practice-mysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advanced SQL Practice

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


What you’ll practice

  • Subqueries + EXISTS
  • Correlated subqueries
  • Window functions (aggregate, ranking, frames)
  • LAG() / LEAD()
  • CTEs (non-recursive + multi-CTE)
  • Recursive CTEs (numbers + employee hierarchy)
  • Date/Time functions

Repo structure

  • exercises/ → prompts-only (try first)
  • solutions/ → complete solutions (reference after)
  • db/ → local DB setup + seed scripts
  • docker-compose.yml → optional local MySQL setup
  • docs/ → how to use + roadmap + style guide
  • archive/ → original work preserved without changes

Quick start

  1. Read: docs/HOW_TO_USE.md
  2. Start practicing: exercises/README.md
  3. Check your work: solutions/

Want a local database with sample data? See db/ (Docker is optional).


Recommended learning path

  1. Subqueries
  2. EXISTS + correlated subqueries
  3. Window functions (ROW_NUMBER, RANK/DENSE_RANK)
  4. Window frames
  5. LAG/LEAD
  6. CTEs
  7. Recursive CTEs
  8. Date/Time patterns

Who this is for

  • 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

Notes

  • MySQL 8+ recommended (for CTEs + window functions).
  • SQL often has multiple correct answers — solutions are reference implementations.

Support

If this repo helps you practice SQL, consider starring it ⭐ — it helps more learners discover it.

Releases

No releases published

Packages

 
 
 

Contributors

Languages