Skip to content

Latest commit

Β 

History

33 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ—ƒοΈ SQL-50 β€” LeetCode SQL Problem Solutions

SQL LeetCode Problems Solved Status

Solving 50 SQL problems on LeetCode β€” from basic JOINs to advanced window functions.
Clean, well-commented solutions organised by concept. Updated daily.


πŸ“Œ Why This Repo?

SQL is tested in almost every Data Analyst, ML Engineer, and Backend role interview.
This repo is my structured practice log β€” each solution includes the problem link, approach, and clean query.


βœ… Problems Solved

# Problem Difficulty Concept Solution
1 Combine Two Tables 🟒 Easy LEFT JOIN View
2 Second Highest Salary 🟑 Medium LIMIT + OFFSET View
3 Nth Highest Salary 🟑 Medium Stored Function View
4 Rank Scores 🟑 Medium DENSE_RANK View
5 Consecutive Numbers 🟑 Medium Self JOIN View

πŸ”„ More problems being added daily β€” check back soon!


πŸ“š Concepts Covered (Roadmap)

βœ… JOINs          β†’ INNER, LEFT, RIGHT, SELF JOIN
βœ… Window Funcs   β†’ RANK, DENSE_RANK, ROW_NUMBER
βœ… Subqueries     β†’ Scalar, Correlated, IN / NOT IN
πŸ”² Aggregations   β†’ GROUP BY, HAVING, COUNT, SUM
πŸ”² String Funcs   β†’ CONCAT, SUBSTRING, LIKE
πŸ”² Date Funcs     β†’ DATEDIFF, DATE_FORMAT, NOW()
πŸ”² CTEs           β†’ WITH clause, recursive queries
πŸ”² NULL Handling  β†’ IFNULL, COALESCE, IS NULL

πŸ› οΈ Tech Stack

  • Database: MySQL (LeetCode environment)
  • Tools: LeetCode SQL Editor, VS Code
  • Language: Standard SQL with MySQL-specific functions

πŸ“ Repo Structure

sql-50/
β”œβ”€β”€ Combine Two Tables          # LEFT JOIN basics
β”œβ”€β”€ Second Highest Salary       # LIMIT + OFFSET / subquery
β”œβ”€β”€ Nth Highest Salary          # Stored function + LIMIT
β”œβ”€β”€ Rank Scores                 # DENSE_RANK window function
β”œβ”€β”€ Consecutive Numbers         # Self JOIN technique
└── README.md

πŸš€ How to Use

  1. Click any problem file to see the SQL solution
  2. Each file has the query + a short comment explaining the approach
  3. Try solving it yourself first on LeetCode before reading!

πŸ‘©β€πŸ’» About Me

Madhura Bhat β€” B.Tech AI & Data Science | Actively seeking Data/ML/GenAI roles

LinkedIn GitHub


⭐ If this helped you, consider starring the repo!

About

πŸ—ƒοΈ 50 LeetCode SQL solutions β€” JOINs, window functions, subqueries & more. Daily updates. | MySQL | Data Analytics

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors