A curated collection of 100 SQL Interview & Practice Questions ranging from Beginner → Advanced, including optimized solutions and real-world business scenarios.
This repository helps you:
- Master SQL fundamentals
- Prepare for technical interviews
- Strengthen analytical thinking
- Practice real-world business problems
- Learn query optimization techniques
| Level | Count | Topics Covered |
|---|---|---|
| Easy | 40 | SELECT, WHERE, ORDER BY, GROUP BY, Aggregations |
| Medium | 35 | JOINs, Subqueries, CASE, CTEs |
| Hard | 25 | Window Functions, Recursive CTE, Advanced Analytics |
Top100-SQL-Practice/
│
├── Dataset/
│ ├── Data.txt
│ ├── DatabaseDesign.svg
│ └── SchemaDefinition.md
│
├── Easy/
│ ├── (1-15).md
│ ├── (16-30).md
│ └── (31-40).md
│
├── Medium/
│ ├── (41-55).md
│ ├── (56-65).md
│ └── (66-75).md
│
├── Hard/
│ ├── (76-90).md
│ └── (91-100).md
│
└── PracticeQuestions/
└── Top100.md
Focus Areas:
- Basic SELECT queries
- Filtering with WHERE
- Sorting with ORDER BY
- Aggregations (COUNT, SUM, AVG, MIN, MAX)
- GROUP BY & HAVING
Skills Developed:
- Data retrieval
- Basic filtering
- Simple reporting queries
Focus Areas:
- INNER JOIN, LEFT JOIN
- Correlated & Non-correlated Subqueries
- CASE statements
- Common Table Expressions (CTEs)
- Multi-table aggregations
Skills Developed:
- Data relationships
- Business logic implementation
- Analytical reporting
Focus Areas:
- Window Functions (RANK, DENSE_RANK, ROW_NUMBER, LAG, LEAD)
- Recursive CTE
- Running totals & moving averages
- Advanced aggregations
- Revenue & growth analytics
- Fraud detection patterns
Skills Developed:
- Advanced analytics
- Performance optimization thinking
- Real-world business intelligence queries
The questions are based on a realistic E-Commerce Database Schema, including:
- Customers
- Orders
- Order_Items
- Products
- Categories
- Payments
- Addresses
- Choose a difficulty level
- Solve the question independently
- Compare with the provided solution
- Review the explanation
- Try optimizing the query
💡 Pro Tip: Solve without looking at the answer first.
Become SQL confident.
Think in queries.
Solve problems like a Data Professional.
Minor result differences may occur due to:
- Date functions (e.g.,
CURDATE()) - Rounding variations
- SQL dialect differences (MySQL / PostgreSQL / SQL Server)
- Changes in sample data
If you notice any issue, simply report the question number and the problem — I’ll fix it.
Happy Querying! 🚀