{"id":28331847,"url":"https://github.com/rakshitgupta9/leetcode-sql-50","last_synced_at":"2026-02-20T01:01:56.024Z","repository":{"id":248168943,"uuid":"827679388","full_name":"Rakshitgupta9/Leetcode-SQL-50","owner":"Rakshitgupta9","description":"This repo have solutions for the SQL-50 which are from leetcode","archived":false,"fork":false,"pushed_at":"2024-07-12T11:15:45.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T05:38:39.392Z","etag":null,"topics":["leetcode","leetcode-solutions","leetcode-sql-50","leetcode-sql-solutions","sql"],"latest_commit_sha":null,"homepage":"https://leetcode.com/studyplan/top-sql-50/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rakshitgupta9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-12T06:43:04.000Z","updated_at":"2024-07-12T17:53:18.000Z","dependencies_parsed_at":"2024-07-12T21:12:50.755Z","dependency_job_id":null,"html_url":"https://github.com/Rakshitgupta9/Leetcode-SQL-50","commit_stats":null,"previous_names":["rakshitgupta9/leetcode-sql-50"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Rakshitgupta9/Leetcode-SQL-50","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rakshitgupta9%2FLeetcode-SQL-50","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rakshitgupta9%2FLeetcode-SQL-50/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rakshitgupta9%2FLeetcode-SQL-50/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rakshitgupta9%2FLeetcode-SQL-50/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rakshitgupta9","download_url":"https://codeload.github.com/Rakshitgupta9/Leetcode-SQL-50/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rakshitgupta9%2FLeetcode-SQL-50/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260692757,"owners_count":23047486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["leetcode","leetcode-solutions","leetcode-sql-50","leetcode-sql-solutions","sql"],"created_at":"2025-05-26T18:58:04.499Z","updated_at":"2025-10-16T04:21:13.761Z","avatar_url":"https://github.com/Rakshitgupta9.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leetcode-SQL-50 Solutions\n\nWelcome to the repository for the solutions to the top 50 SQL questions on LeetCode! This repository contains my solutions to the SQL problems listed in the [LeetCode Top SQL 50 Study Plan](https://leetcode.com/studyplan/top-sql-50/).\n\n[My Leetcode](https://leetcode.com/u/rakshitgupta9/) \n\n![image](https://github.com/user-attachments/assets/b1e13817-21a9-48d0-93d4-66227268501d)\n\n\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Solutions](#solutions)\n  - [Select](#select)\n  - [Basic Joins](#basic-joins)\n  - [Basic Aggregate Functions](#basic-aggregate-functions)\n  - [Sorting and Grouping](#sorting-and-grouping)\n  - [Advanced Select and Joins](#advanced-select-and-joins)\n  - [Subqueries](#subqueries)\n  - [Advanced String Functions / Regex / Clause](#advanced-string-functions-regex-clause)\n- [Usage](#usage)\n- [Contact](#contact)\n\n## Introduction\n\nThis repository provides solutions to the top 50 SQL problems on LeetCode. Each problem is solved and the solution is provided in a SQL file. These problems cover various SQL concepts and are aimed at improving SQL querying skills.\n\n## Solutions\n\nThe solutions are organized in the following structure:\n\n### Select\n\n- [Recyclable and Low Fat Products](./Select/Recyclable_and_Low_Fat_Products.sql)\n- [Find Customer Referee](./Select/Find_Customer_Referee.sql)\n- [Big Countries](./Select/Big_Countries.sql)\n- [Article Views I](./Select/Article_Views_I.sql)\n- [Invalid Tweets](./Select/Invalid_Tweets.sql)\n\n### Basic Joins\n\n- [Replace Employee ID With The Unique Identifier](./Basic_Joins/Replace_Employee_ID_With_The_Unique_Identifier.sql)\n- [Product Sales Analysis I](./Basic_Joins/Product_Sales_Analysis_I.sql)\n- [Customer Who Visited but Did Not Make Any Transactions](./Basic_Joins/Customer_Who_Visited_but_Did_Not_Make_Any_Transactions.sql)\n- [Rising Temperature](./Basic_Joins/Rising_Temperature.sql)\n- [Average Time of Process per Machine](./Basic_Joins/Average_Time_of_Process_per_Machine.sql)\n- [Employee Bonus](./Basic_Joins/Employee_Bonus.sql)\n- [Students and Examinations](./Basic_Joins/Students_and_Examinations.sql)\n- [Managers with at Least 5 Direct Reports](./Basic_Joins/Managers_with_at_Least_5_Direct_Reports.sql)\n- [Confirmation Rate](./Basic_Joins/Confirmation_Rate.sql)\n\n### Basic Aggregate Functions\n\n- [Not Boring Movies](./Basic_Aggregate_Functions/Not_Boring_Movies.sql)\n- [Average Selling Price](./Basic_Aggregate_Functions/Average_Selling_Price.sql)\n- [Project Employees I](./Basic_Aggregate_Functions/Project_Employees_I.sql)\n- [Percentage of Users Attended a Contest](./Basic_Aggregate_Functions/Percentage_of_Users_Attended_a_Contest.sql)\n- [Queries Quality and Percentage](./Basic_Aggregate_Functions/Queries_Quality_and_Percentage.sql)\n- [Monthly Transactions I](./Basic_Aggregate_Functions/Monthly_Transactions_I.sql)\n- [Immediate Food Delivery II](./Basic_Aggregate_Functions/Immediate_Food_Delivery_II.sql)\n- [Game Play Analysis IV](./Basic_Aggregate_Functions/Game_Play_Analysis_IV.sql)\n\n### Sorting and Grouping\n\n- [Number of Unique Subjects Taught by Each Teacher](./Sorting_and_Grouping/Number_of_Unique_Subjects_Taught_by_Each_Teacher.sql)\n- [User Activity for the Past 30 Days I](./Sorting_and_Grouping/User_Activity_for_the_Past_30_Days_I.sql)\n- [Product Sales Analysis III](./Sorting_and_Grouping/Product_Sales_Analysis_III.sql)\n- [Classes More Than 5 Students](./Sorting_and_Grouping/Classes_More_Than_5_Students.sql)\n- [Find Followers Count](./Sorting_and_Grouping/Find_Followers_Count.sql)\n- [Biggest Single Number](./Sorting_and_Grouping/Biggest_Single_Number.sql)\n- [Customers Who Bought All Products](./Sorting_and_Grouping/Customers_Who_Bought_All_Products.sql)\n\n### Advanced Select and Joins\n\n- [The Number of Employees Which Report to Each Employee](./Advanced_Select_and_Joins/The_Number_of_Employees_Which_Report_to_Each_Employee.sql)\n- [Primary Department for Each Employee](./Advanced_Select_and_Joins/Primary_Department_for_Each_Employee.sql)\n- [Triangle Judgement](./Advanced_Select_and_Joins/Triangle_Judgement.sql)\n- [Consecutive Numbers](./Advanced_Select_and_Joins/Consecutive_Numbers.sql)\n- [Product Price at a Given Date](./Advanced_Select_and_Joins/Product_Price_at_a_Given_Date.sql)\n- [Last Person to Fit in the Bus](./Advanced_Select_and_Joins/Last_Person_to_Fit_in_the_Bus.sql)\n- [Count Salary Categories](./Advanced_Select_and_Joins/Count_Salary_Categories.sql)\n\n### Subqueries\n\n- [Employees Whose Manager Left the Company](./Subqueries/Employees_Whose_Manager_Left_the_Company.sql)\n- [Exchange Seats](./Subqueries/Exchange_Seats.sql)\n- [Movie Rating](./Subqueries/Movie_Rating.sql)\n- [Restaurant Growth](./Subqueries/Restaurant_Growth.sql)\n- [Friend Requests II: Who Has the Most Friends](./Subqueries/Friend_Requests_II_Who_Has_the_Most_Friends.sql)\n- [Investments in 2016](./Subqueries/Investments_in_2016.sql)\n- [Department Top Three Salaries](./Subqueries/Department_Top_Three_Salaries.sql)\n\n### Advanced String Functions / Regex / Clause\n\n- [Fix Names in a Table](./Advanced_String_Functions_Regex_Clause/Fix_Names_in_a_Table.sql)\n- [Patients With a Condition](./Advanced_String_Functions_Regex_Clause/Patients_With_a_Condition.sql)\n- [Delete Duplicate Emails](./Advanced_String_Functions_Regex_Clause/Delete_Duplicate_Emails.sql)\n- [Second Highest Salary](./Advanced_String_Functions_Regex_Clause/Second_Highest_Salary.sql)\n- [Group Sold Products By The Date](./Advanced_String_Functions_Regex_Clause/Group_Sold_Products_By_The_Date.sql)\n- [List the Products Ordered in a Period](./Advanced_String_Functions_Regex_Clause/List_the_Products_Ordered_in_a_Period.sql)\n- [Find Users With Valid E-Mails](./Advanced_String_Functions_Regex_Clause/Find_Users_With_Valid_E_Mails.sql)\n\n## Usage\n\n1. Clone this repository to your local machine:\n\n```bash\ngit clone https://github.com/Rakshitgupta9/Leetcode-SQL-50.git\n```\n\n2. Navigate to the directory:\n\n```bash\ncd Leetcode-SQL-50\n```\n\n3. Open the SQL file for the problem you want to review.\n\nYou can run these SQL queries on your local SQL server or any SQL-based platform.\n\n\n## Contact\n\nIf you have any questions or suggestions, feel free to reach out to me at:\n\n- **Name**: [Rakshit Gupta](https://github.com/Rakshitgupta9/)\n- **Email**: guptarakshit9858@gmail.com\n- **LinkedIn**: [Rakshit Gupta](https://www.linkedin.com/in/rakshit9/)\n\nThank you for visiting this repository. Happy coding!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frakshitgupta9%2Fleetcode-sql-50","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frakshitgupta9%2Fleetcode-sql-50","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frakshitgupta9%2Fleetcode-sql-50/lists"}