Welcome to the SQL Challenge Repository! This repository contains 9 of the most challenging and unique SQL problems, specially selected to enhance your SQL skills. Each challenge folder includes:
- A SQL script file solving the challenge.
- A detailed README file explaining the step-by-step solution.
These challenges are for educational purposes, and I encourage you to dive in, experiment, and even submit your own solutions! Whether you have alternative approaches, suggestions for improvement, or feedback, feel free to open a pull request.
All challenges are solved in MS SQL Server. To run the queries, you will need to have one of the following installed:
- SQL Server Management Studio (SSMS)
- Azure Data Studio
Both are free to download and set up. Instructions for setting up SQL Server are available here.
- Challenge 1: Calculating the number of remaining inventories
- Challenge 2: Batch Allocation for Customer Orders
- Challenge 3: HackerRank - “15 Days of Learning SQL”
- Challenge 4: Maximize Prime Item Inventory [Amazon SQL Interview Question]
- Challenge 5: 2494 - Merge Overlapping Events in the Same Hall [LeetCode]
- Challenge 6: Identifying Customers with Consecutive Increasing Transactions
- Challenge 7: 1645 - Hopper Company Queries II [LeetCode]
- Challenge 8: 1127. User Purchase Platform [LeetCode]
- Challenge 9: 1384 - Total Sales Amount by Year [LeetCode]