Welcome to my LeetCode SQL 50 solution repository! This repository contains well-structured, optimized SQL solutions for all LeetCode SQL 50 problems, along with detailed explanations to enhance your understanding.
LeetCode SQL 50 is a curated list of essential SQL problems designed to improve database querying skills for technical interviews, data analytics, and software development. These problems cover a broad range of SQL concepts, including Joins, Aggregate Functions, Subqueries, and String Functions.
The solutions are categorized based on SQL topics for easy navigation:
- Advanced Select and Joins
- Advanced String Functions / Regex / Clause
- Basic Aggregate Functions
- Basic Joins
- Select
- Sorting and Grouping
- Subqueries
I have solved all LeetCode SQL 50 problems, and they are organized based on their topics. You can find the solutions in their respective folders/files.
To get a local copy, use the following command:
git clone https://github.com/suman105/LeetCode-SQL-50.git
cd LeetCode-SQL-50Ensure you have MySQL or PostgreSQL installed on your system. You can use any database management system that supports SQL.
You can execute the queries in your preferred SQL environment (e.g., MySQL Workbench, PostgreSQL, SQLite, or an online SQL compiler).
- To run a SQL file using MySQL command line:
mysql -u your_username -p your_database < filename.sql- For PostgreSQL:
psql -U your_username -d your_database -f filename.sqlContributions are welcome! Feel free to fork this repository, suggest improvements, or add alternative solutions. To contribute:
- Fork the repository.
- Create a new branch.
git checkout -b feature-branch
- Commit your changes.
git commit -am 'Add new SQL solution' - Push to your fork.
git push origin feature-branch
- Open a pull request.
If you find this repository helpful, consider giving it a star ⭐ on GitHub. Your support motivates me to continue improving and adding more solutions! 🚀
Happy Querying! 🖥️📊