Skip to content

This repository contains my solutions to the 50 SQL problems on LeetCode.

Notifications You must be signed in to change notification settings

mennaabdelelhady/SQL-50

Repository files navigation

SQL-50 LeetCode Solutions

This repository contains my solutions to the 50 SQL problems on LeetCode. I aim to solve one problem per day and add my solutions here. The goal of this project is to practice and improve my SQL skills, focusing on various types of SQL queries, optimization techniques, and solving real-world database challenges.


Table of Contents


Overview

The SQL-50 LeetCode Solutions repository is a collection of SQL queries and their solutions to the 50 SQL problems on LeetCode. The repository is intended to help developers improve their SQL problem-solving skills by practicing with real-world examples.


Problems Solved

As of today, I have solved the following problems:

  1. Recyclable and Low Fat Products
  2. Find Customer Referee
  3. Big Countries
  4. Article Views I
  5. Invalid Tweets
  6. Replace Employee ID With The Unique Identifier
  7. Product Sales Analysis I
  8. Customer Who Visited but Did Not Make Any Transactions
  9. Rising Temperature
  10. Average Time of Process per Machine
  11. 577. Employee Bonus
  12. 1280. Students and Examinations
  13. 570. Managers with at Least 5 Direct Reports
  14. 1934. Confirmation Rate
  15. 620. Not Boring Movies
  16. 1251. Average Selling Price
  17. 1075. Project Employees I
  18. 1633. Percentage of Users Attended a Contest
  19. 1211. Queries Quality and Percentage
  20. 1193. Monthly Transactions I
  21. 1174. Immediate Food Delivery II
  22. 550. Game Play Analysis IV
  23. 2356. Number of Unique Subjects Taught by Each Teacher
  24. 1141. User Activity for the Past 30 Days I
  25. 1070. Product Sales Analysis III
  26. 596. Classes More Than 5 Students
  27. 1729. Find Followers Count
  28. 619. Biggest Single Number
  29. 1045. Customers Who Bought All Products
  30. 1731. The Number of Employees Which Report to Each Employee
  31. 1789. Primary Department for Each Employee
  32. 610. Triangle Judgement
  33. 180. Consecutive Numbers
  34. 1164. Product Price at a Given Date
  35. 1204. Last Person to Fit in the Bus
  36. 1907. Count Salary Categories
  37. 1978. Employees Whose Manager Left the Company
  38. 626. Exchange Seats
  39. 1341. Movie Rating
  40. 1321. Restaurant Growth
  41. 602. Friend Requests II: Who Has the Most Friends
  42. 585. Investments in 2016
  43. 185. Department Top Three Salaries
  44. 1667. Fix Names in a Table
  45. 1527. Patients With a Condition
  46. 196. Delete Duplicate Emails
  47. 176. Second Highest Salary
  48. 1484. Group Sold Products By The Date(Current)

I will continue to add solutions daily.


How to Use

  1. Clone the repository to your local machine:

    git clone https://github.com/mennaabdelelhady/SQL-50.git
  2. Navigate to the project directory:

    cd SQL-50
  3. Browse through the individual solutions, which are named according to the problem number.

You can test the SQL queries using your preferred SQL platform (e.g., MySQL, PostgreSQL, SQLite).


Contributing

Feel free to fork the repository, submit issues, or open pull requests with additional SQL solutions or improvements to existing ones. Here are some ways you can contribute:

  • Solve additional SQL problems and submit a pull request.
  • Help improve the performance or readability of existing solutions.
  • Suggest new features or optimization techniques.

License

This repository is open-source and available under the MIT License.


Topics

  • SQL
  • LeetCode
  • Database
  • Query Optimization

About

This repository contains my solutions to the 50 SQL problems on LeetCode.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published