Skip to content

HamzaHassanain/Leetcode_SQL_50_Study_Plan

Repository files navigation

The Solutions for The LeetCode SQL 50 FREE Study Plan

How is this repository organized?

This repository is organized in the same way as the study plan. Each folder in this repository corresponds to a set of questions in the study plan. Each folder contains folders for each question in the set. Each question folder contains a README.md file that contains the solution for the question.

The README.md is organized in the following way:

  • Problem Requirements: The LeetCode problem requirements, with some extra explanation if necessary.
  • Hints: Hints for the problem, you should read this part if you are stuck in the problem, try taking each one at a time and think about it for a bit 5-10 minutes.
  • Explanation: Explanation of the solution, you should read this part after reading all the hints, and after trying to solve the problem by yourself first.
  • SQL Solution: The SQL solution for the problem, you should read this part after reading the explanation in order for it to make some sense.

Folder Structure

├── Advanced Select and Joins
│   ├── 01- The Number of Employees Which Report to Each Employee
│   │   └── README.md
│   ├── 02- Primary Department for Each Employee
│   │   └── README.md
│   ├── 03- Triangle Judgement
│   │   └── README.md
│   ├── 04- Consecutive Numbers
│   │   └── README.md
│   ├── 05- Product Price at a Given Date
│   │   └── README.md
│   ├── 06- Last Person to Fit in the Bus
│   │   └── README.md
│   └── 07- Count Salary Categories
│       └── README.md
├── Advanced String Functions, Regex, Clause
│   ├── 01 Fix Names in a Table
│   │   └── README.md
│   ├── 02- Patients With a Condition
│   │   └── README.md
│   ├── 03 Delete Duplicate Emails
│   │   └── README.md
│   ├── 04- Second Highest Salary
│   │   └── README.md
│   ├── 05 Group Sold Products By The Date
│   │   └── README.md
│   ├── 06- List the Products Ordered in a Period
│   │   └── README.md
│   └── 07 Find Users With Valid E-Mails
│       └── README.md
├── Basic Aggregate Functions
│   ├── 01- Not Boring Movies
│   │   └── README.md
│   ├── 02- Average Selling Price
│   │   └── README.md
│   ├── 03- Project Employees I
│   │   └── README.md
│   ├── 04- Percentage of Users Attended a Contest
│   │   └── README.md
│   ├── 05- Queries Quality and Percentage
│   │   └── README.md
│   ├── 06 -Monthly Transactions I
│   │   └── README.md
│   ├── 07- Immediate Food Delivery II
│   │   └── README.md
│   └── 08 -Game Play Analysis IV
│       └── README.md
├── Basic Joins
│   ├── 01- Replace Employee ID With The Unique Identifier
│   │   └── README.md
│   ├── 02- Product Sales Analysis I
│   │   └── README.md
│   ├── 03- Customer Who Visited but Did Not Make Any
│   │   └── README.md
│   ├── 04- Rising Temperature
│   │   └── README.md
│   ├── 05- Average Time of Process per Machine
│   │   └── README.md
│   ├── 06- Employee Bonus
│   │   └── README.md
│   ├── 07- Students and Examinations
│   │   └── README.md
│   ├── 08- Managers with at Least 5 Direct Reports
│   │   └── README.md
│   └── 09- Confirmation Rate
│       └── README.md
├── README.md
├── Select
│   ├── 01- Recyclable and Low Fat Products
│   │   └── README.md
│   ├── 02-Find Customer Referee
│   │   └── README.md
│   ├── 03 -Big Countries
│   │   └── README.md
│   ├── 04-Article Views I
│   │   └── README.md
│   └── 05- Invalid Tweets
│       └── README.md
├── Sorting and Grouping
│   ├── 01- Number of Unique Subjects Taught by Each Teacher
│   │   └── README.md
│   ├── 02- User Activity for the Past 30 Days I
│   │   └── README.md
│   ├── 03- Product Sales Analysis III
│   │   └── README.md
│   ├── 04- Classes More Than 5 Students
│   │   └── README.md
│   ├── 05- Find Followers Count
│   │   └── README.md
│   ├── 06- Biggest Single Number
│   │   └── README.md
│   └── 07- Customers Who Bought All Products
│       └── README.md
└── Subqueries
    ├── 01- Employees Whose Manager Left the Company
    │   └── README.md
    ├── 02- Exchange Seats
    │   └── README.md
    ├── 03- Movie Rating
    │   └── README.md
    ├── 04- Restaurant Growth
    │   └── README.md
    ├── 05- Friend Requests II: Who Has the Most Friends
    │   └── README.md
    ├── 06- Investments in 2016
    │   └── README.md
    └── 07- Department Top Three Salaries
        └── README.md

Our Template

# [Problem name](https://problem-link-on-leetcode.com)

### Problem Requirements:

Problem requirements go here.

<details>
<summary style="font-size:1.3rem;"> <strong>Hints</strong> </summary>

<details>
      <summary>Hint#1-10</summary>
      <p>hint body goes here</p>
</details>

</details>

<details>
<summary style="font-size:1.3rem;"> <strong>Explanation</strong> </summary>

Explanation goes here.

</details>

<details>
<summary style="font-size:1.3rem"><strong> SQL Solution</strong> </summary>

```sql
    SQL code goes here
```

</details>

Releases

No releases published

Packages

No packages published