Skip to content

abhiXsliet/Leetcode-SQL-50

Repository files navigation

LeetCode SQL 50 Solutions 🚀

This repository contains well-organized and optimized solutions for the Top 50 SQL Problems from the LeetCode SQL Study Plan. The solutions are categorized into folders based on specific topics, ensuring clarity and ease of navigation.


📂 Folder Structure

The repository is structured as follows:

├── 001 Select/
├── 002 Basic Joins/
├── 003 Basic Aggregate Functions/
├── 004 Sorting and Grouping/
├── 005 Advanced Select and Joins/
├── 006 Subqueries/
├── 007 Advanced String Functions, Regex, Clause/
├── LICENSE
└── README.md

Each folder contains .sql files corresponding to problems that focus on the respective topic.


🛠 Topics Covered

The solutions in this repository cover a wide range of SQL concepts:

  • Select Statements: Basic querying with SELECT and WHERE clauses.
  • Joins: Understanding and applying INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL OUTER JOIN.
  • Aggregate Functions: Utilizing SUM, AVG, COUNT, MIN, and MAX.
  • Sorting and Grouping: Leveraging GROUP BY, ORDER BY, and HAVING for data aggregation and sorting.
  • Advanced Queries: Complex joins, nested queries, and subqueries.
  • String Functions and Regex: Manipulating text data using advanced SQL functions.
  • Clauses: Implementing CASE, LIMIT, OFFSET, and other advanced clauses.

💡 How to Use

  1. Clone this repository:

    git clone https://github.com/abhixsliet/leetcode-sql-50.git
    cd leetcode-sql-50
  2. Navigate to the relevant folder for the topic you want to practice.

  3. Open the .sql files in your preferred SQL environment (e.g., MySQL, PostgreSQL, SQL Server).

  4. Practice the problems alongside the LeetCode SQL Study Plan.


🚀 Features

  • Topic-based categorization for easy navigation and learning.
  • Optimized solutions written for performance and clarity.
  • Solutions include real-world problem-solving techniques to prepare for interviews.

🤝 Contributions

Contributions are welcome! If you'd like to add new solutions or optimize existing ones, feel free to open an issue or submit a pull request.


📜 License

This repository is licensed under the MIT License. You can use the code for personal and educational purposes.


🌟 Acknowledgments

  • Thanks to LeetCode for providing these SQL problems.
  • The SQL community for inspiring collaborative learning and improvement.

If this repository helps you, consider giving it a ⭐!
Happy coding! 😊

About

This repository contains my solutions to all 50 SQL problems from LeetCode.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published