Skip to content

This repository contains solutions to 50 SQL problems from Leetcode, categorized into various SQL concepts. It serves as a learning resource for SQL enthusiasts and a quick reference for solving common SQL queries.

Notifications You must be signed in to change notification settings

HarshitLaloriya/Leetcode-SQL-50

Repository files navigation

Leetcode-SQL-50 🗄️

Welcome to the Leetcode-SQL-50 repository! This repository contains solutions to 50 SQL problems from Leetcode, carefully categorized based on different SQL concepts. It's designed as a resource for anyone looking to improve their SQL skills, whether you're a beginner or looking to refine your existing knowledge. Leetcode SQL 50

🚀 Project Overview

This repository is divided into several categories, each covering specific SQL concepts:

Advance Select and Joins: 7 Problems

Basic Aggregate Functions: 8 Problems

Basic Joins: 9 Problems

Select Statement: 5 Problems

Sorting and Grouping: 7 Problems

Subqueries: 7 Problems

Advanced String Functions / Regex / Clause: 7 Problems

Each folder contains SQL scripts for the respective problems, along with a brief description of the problem and the approach used to solve it.

📂 Folder Structure

The repository is organized as follows:

📦 Leetcode-SQL-50
┣ 📂 ADVANCE SELECT AND JOINS
┣ 📂 ADVANCED STRING FUNCTIONS / REGEX / CLAUSE
┣ 📂 BASIC AGGREGATE FUNCTIONS
┣ 📂 BASIC JOINS
┣ 📂 SELECT
┣ 📂 SORTING AND GROUPING
┗ 📂 SUBQUERIES

🛠️ How to Use

To use this repository:

1️⃣ Navigate to the folder that corresponds to the SQL concept you're interested in.

2️⃣ Open the SQL script file of the specific problem.

3️⃣ Run the SQL query in your preferred SQL environment (e.g., MySQL, PostgreSQL).

Each solution is accompanied by comments as well as Question(at line 101) too, to explain the approach and logic.

🎯 Key Concepts Covered

Here’s a quick glance at the key SQL concepts covered in this repository:

  • Select Statements: Retrieve data from a database.
  • Joins: Combine rows from two or more tables.
  • Aggregation: Perform calculations on multiple rows to return a single value.
  • Subqueries: Nested queries to filter and manipulate data.
  • Sorting and Grouping: Organize data in a meaningful way.

🌟 Why Use This Repository?

  • Structured Learning: Problems are categorized by SQL concepts, making it easy to focus on specific areas.
  • Hands-On Practice: Improve your SQL skills by solving real-world problems.
  • Quick Reference: Use the solutions as a reference when working on similar problems in the future.

📈 Future Work

Here are some ideas for expanding this repository:

  • Add More Problems: Include more SQL problems, especially covering advanced concepts like window functions.
  • Detailed Explanations: Add more comments or a markdown file to explain each solution in depth.
  • Interactive Examples: Create a web interface to interact with the SQL queries directly.

🤝 Contributions

Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.

🙌 Acknowledgments

Special thanks to LeetCode for providing such great problems to solve. This repository wouldn’t be possible without their resources.

GitHub stars GitHub forks SQL

symbol

About

This repository contains solutions to 50 SQL problems from Leetcode, categorized into various SQL concepts. It serves as a learning resource for SQL enthusiasts and a quick reference for solving common SQL queries.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published