{"id":29440876,"url":"https://github.com/ivanbyone/awesome-leetcode-sql","last_synced_at":"2025-07-13T12:17:13.287Z","repository":{"id":301870615,"uuid":"1010098846","full_name":"Ivanbyone/awesome-leetcode-sql","owner":"Ivanbyone","description":"LeetCode SQL Solutions in PostgreSQL","archived":false,"fork":false,"pushed_at":"2025-07-09T19:19:48.000Z","size":1081,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-10T01:19:13.374Z","etag":null,"topics":["awesome-sql","interview-preparation","leetcode","leetcode-solutions","leetcode-sql","leetcode-sql-50","pgsql","postgresql","sql"],"latest_commit_sha":null,"homepage":"","language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ivanbyone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-06-28T10:42:22.000Z","updated_at":"2025-07-09T19:19:47.000Z","dependencies_parsed_at":"2025-06-29T10:31:29.303Z","dependency_job_id":"0523e205-20e8-4a4b-9b31-1a87103930e4","html_url":"https://github.com/Ivanbyone/awesome-leetcode-sql","commit_stats":null,"previous_names":["ivanbyone/leetcode-sql","ivanbyone/awesome-leetcode-sql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ivanbyone/awesome-leetcode-sql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ivanbyone%2Fawesome-leetcode-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ivanbyone%2Fawesome-leetcode-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ivanbyone%2Fawesome-leetcode-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ivanbyone%2Fawesome-leetcode-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ivanbyone","download_url":"https://codeload.github.com/Ivanbyone/awesome-leetcode-sql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ivanbyone%2Fawesome-leetcode-sql/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265137078,"owners_count":23716784,"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":["awesome-sql","interview-preparation","leetcode","leetcode-solutions","leetcode-sql","leetcode-sql-50","pgsql","postgresql","sql"],"created_at":"2025-07-13T12:17:10.371Z","updated_at":"2025-07-13T12:17:13.244Z","avatar_url":"https://github.com/Ivanbyone.png","language":"PLpgSQL","readme":"# Leetcode (PostgreSQL)\n\n![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white)\n[![MIT licensed](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)\n[![CI](https://github.com/ivanbyone/leetcode-sql/actions/workflows/ci.yml/badge.svg)](https://github.com/Ivanbyone/leetcode-sql//actions)\n\n## Navigation\n\n- [Description](#description)\n- [SQL 50](#sql-50-questions)\n- [All Tasks list](#all-tasks-list)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Description\n\n📚 LeetCode SQL Solutions in PostgreSQL\n\nA collection of LeetCode solutions in SQL using PostgreSQL. Includes:\n- Easy/Medium/Hard solutions\n- Optimized queries\n\n🔹 Features:\n- Clean, formatted SQL code\n- Use of PostgreSQL-specific functions\n- Parsing complex queries\n- Regular updates\n\nUseful for preparing for technical interviews and improving your SQL skills.\n\n## SQL 50 Questions\n\n![SQL 50 Badge](./public/sql-50.GIF)\n\n### Select\n\n- [595. Big Countries](./leetcode/easy/595.%20Big%20Countries.sql)\n- [1148. Article Views I](./leetcode/easy/1148.%20Article%20Views%20I.sql)\n- [1683. Invalid Tweets](./leetcode/easy/1683.%20Invalid%20Tweets.sql)\n\n### Basic Joins\n\n- [1378. Replace Employee ID With The Unique Identifier](./leetcode/easy/1378.%20Replace%20Employee%20ID%20With%20The%20Unique%20Identifier.sql)\n- [1068. Product Sales Analysis I](./leetcode/easy/1068.%20Product%20Sales%20Analysis%20I.sql)\n- [1581. Customer Who Visited but Did Not Make Any Transactions](./leetcode/easy/1581.%20Customer%20Who%20Visited%20but%20Did%20Not%20Make%20Any%20Transactions.sql)\n- [197. Rising Temperature](./leetcode/easy/197.%20Rising%20Temperature.sql)\n- [1661. Average Time of Process per Machine](./leetcode/easy/1661.%20Average%20Time%20of%20Process%20per%20Machine.sql)\n- [577. Employee Bonus](./leetcode/easy/577.%20Employee%20Bonus.sql)\n- [1280. Students and Examinations](./leetcode/easy/1280.%20Students%20and%20Examinations.sql)\n- [570. Managers with at Least 5 Direct Reports](./leetcode/medium/570.%20Managers%20with%20at%20Least%205%20Direct%20Reports.sql)\n- [1934. Confirmation Rate](./leetcode/medium/1934.%20Confirmation%20Rate.sql)\n\n### Basic Aggregate Functions\n\n- [620. Not Boring Movies](./leetcode/easy/620.%20Not%20Boring%20Movies.sql)\n- [1251. Average Selling Price](./leetcode/easy/1251.%20Average%20Selling%20Price.sql)\n- [1075. Project Employees I](./leetcode/easy/1075.%20Project%20Employees%20I.sql)\n- [1633. Percentage of Users Attended a Contest](./leetcode/easy/1633.%20Percentage%20of%20Users%20Attended%20a%20Contest.sql)\n- [1211. Queries Quality and Percentage](./leetcode/easy/1211.%20Queries%20Quality%20and%20Percentage.sql)\n- [1193. Monthly Transactions I](./leetcode/medium/1193.%20Monthly%20Transactions%20I.sql)\n- [1174. Immediate Food Delivery II](./leetcode/medium/1174.%20Immediate%20Food%20Delivery%20II.sql)\n- [550. Game Play Analysis IV](./leetcode/medium/550.%20Game%20Play%20Analysis%20IV.sql)\n\n### Sorting and Grouping\n\n- [2356. Number of Unique Subjects Taught by Each Teacher](./leetcode/easy/2356.%20Number%20of%20Unique%20Subjects%20Taught%20by%20Each%20Teacher.sql)\n- [1141. User Activity for the Past 30 Days I](./leetcode/easy/1141.%20User%20Activity%20for%20the%20Past%2030%20Days%20I.sql)\n- [1070. Product Sales Analysis III](./leetcode/medium/1070.%20Product%20Sales%20Analysis%203.sql)\n- [596. Classes With at Least 5 Students](./leetcode/easy/596.%20Classes%20With%20at%20Least%205%20Students.sql)\n- [1729. Find Followers Count](./leetcode/easy/1729.%20Find%20Followers%20Count.sql)\n- [619. Biggest Single Number](./leetcode/easy/619.%20Biggest%20Single%20Number.sql)\n- [1045. Customers Who Bought All Products](./leetcode/medium/1045.%20Customers%20Who%20Bought%20All%20Products.sql)\n\n### Advanced Select and Joins\n\n- [1731. The Number of Employees Which Report to Each Employee](./leetcode/easy/1731.%20The%20Number%20of%20Employees%20Which%20Report%20to%20Each%20Employee.sql)\n- [1789. Primary Department for Each Employee](./leetcode/easy/1789.%20Primary%20Department%20for%20Each%20Employee.sql)\n- [610. Triangle Judgement](./leetcode/easy/610.%20Triangle%20Judgement.sql)\n- [180. Consecutive Numbers](./leetcode/medium/180.%20Consecutive%20Numbers.sql)\n- [1164. Product Price at a Given Date](./leetcode/medium/1164.%20Product%20Price%20at%20a%20Given%20Date.sql)\n- [1204. Last Person to Fit in the Bus](./leetcode/medium/1204.%20Last%20Person%20to%20Fit%20in%20the%20Bus.sql)\n- [1907. Count Salary Categories](./leetcode/medium/1907.%20Count%20Salary%20Categories.sql)\n\n### Subqueries\n\n- [1978. Employees Whose Manager Left the Company](./leetcode/easy/1978.%20Employees%20Whose%20Manager%20Left%20the%20Company.sql)\n- [626. Exchange Seats](./leetcode/medium/626.%20Exchange%20Seats.sql)\n- [1321. Restaurant Growth](./leetcode/medium/1321.%20Restaurant%20Growth.sql)\n- [1341. Movie Rating](./leetcode/medium/1341.%20Movie%20Rating.sql)\n- [602. Friend Requests II: Who Has the Most Friends](./leetcode/medium/602.%20Friend%20Requests%20II:%20Who%20Has%20the%20Most%20Friends.sql)\n- [585. Investments in 2016](./leetcode/medium/585.%20Investments%20in%202016.sql)\n- [185. Department Top Three Salaries](./leetcode/hard/185.%20Department%20Top%20Three%20Salaries.sql)\n\n### Advanced String Functions / Regex / Clause\n\n- [1667. Fix Names in a Table](./leetcode/easy/1667.%20Fix%20Names%20in%20a%20Table.sql)\n- [1527. Patients With a Condition](./leetcode/easy/1527.%20Patients%20With%20a%20Condition.sql)\n- [176. Second Highest Salary](./leetcode/medium/176.%20Second%20Highest%20Salary.sql)\n- [1484. Group Sold Products By The Date](./leetcode/easy/1484.%20Group%20Sold%20Products%20By%20The%20Date.sql)\n- [196. Delete Duplicate Emails](./leetcode/easy/196.%20Delete%20Duplicate%20Emails.sql)\n- [1327. List the Products Ordered in a Period](./leetcode/easy/1327.%20List%20the%20Products%20Ordered%20in%20a%20Period.sql)\n- [1517. Find Users With Valid E-Mails](./leetcode/easy/1517.%20Find%20Users%20With%20Valid%20E-Mails.sql)\n\n## All Tasks List\n\n1. [Easy](./leetcode/easy/)\n    - [175. Combine Two Tables](./leetcode//easy/175.%20Combine%20Two%20Tables.sql)\n    - [181. Employees Earning More Than Their Managers](./leetcode/easy/181.%20Employees%20Earning%20More%20Than%20Their%20Managers.sql)\n    - [182. Duplicate Emails](./leetcode/easy/182.%20Duplicate%20Emails.sql)\n    - [183. Customers Who Never Order](./leetcode/easy/183.%20Customers%20Who%20Never%20Order.sql)\n    - [196. Delete Duplicate Emails](./leetcode/easy/196.%20Delete%20Duplicate%20Emails.sql)\n    - [197. Rising Temperature](./leetcode/easy/197.%20Rising%20Temperature.sql)\n    - [511. Game Play Analysis 1](./leetcode/easy/511.%20Game%20Play%20Analysis%201.sql)\n    - [577. Employee Bonus](./leetcode/easy/577.%20Employee%20Bonus.sql)\n    - [586. Customer Placing the Largest Number of Orders](./leetcode/easy/586.%20Customer%20Placing%20the%20Largest%20Number%20of%20Orders.sql)\n    - [595. Big Countries](./leetcode/easy/595.%20Big%20Countries.sql)\n    - [596. Classes With at Least 5 Students](./leetcode/easy/596.%20Classes%20With%20at%20Least%205%20Students.sql)\n    - [607. Sales Person](./leetcode/easy/607.%20Sales%20Person.sql)\n    - [610. Triangle Judgement](./leetcode/easy/610.%20Triangle%20Judgement.sql)\n    - [619. Biggest Single Number](./leetcode/easy/619.%20Biggest%20Single%20Number.sql)\n    - [620. Not Boring Movies](./leetcode/easy/620.%20Not%20Boring%20Movies.sql)\n    - [627. Swap Salary](./leetcode/easy/627.%20Swap%20Salary.sql)\n    - [1050. Actors and Directors Who Cooperated At Least Three Times](./leetcode/easy/1050.%20Actors%20and%20Directors%20Who%20Cooperated%20At%20Least%20Three%20Times.sql)\n    - [1068. Product Sales Analysis I](./leetcode/easy/1068.%20Product%20Sales%20Analysis%20I.sql)\n    - [1075. Project Employees I](./leetcode/easy/1075.%20Project%20Employees%20I.sql)\n    - [1141. User Activity for the Past 30 Days I](./leetcode/easy/1141.%20User%20Activity%20for%20the%20Past%2030%20Days%20I.sql)\n    - [1148. Article Views I](./leetcode/easy/1148.%20Article%20Views%20I.sql)\n    - [1179. Reformat Department Table](./leetcode/easy/1179.%20Reformat%20Department%20Table.sql)\n    - [1211. Queries Quality and Percentage](./leetcode/easy/1211.%20Queries%20Quality%20and%20Percentage.sql)\n    - [1251. Average Selling Price](./leetcode/easy/1251.%20Average%20Selling%20Price.sql)\n    - [1280. Students and Examinations](./leetcode/easy/1280.%20Students%20and%20Examinations.sql)\n    - [1327. List the Products Ordered in a Period](./leetcode/easy/1327.%20List%20the%20Products%20Ordered%20in%20a%20Period.sql)\n    - [1378. Replace Employee ID With The Unique Identifier](./leetcode/easy/1378.%20Replace%20Employee%20ID%20With%20The%20Unique%20Identifier.sql)\n    - [1407. Top Travellers](./leetcode/easy/1407.%20Top%20Travellers.sql)\n    - [1484. Group Sold Products By The Date](./leetcode/easy/1484.%20Group%20Sold%20Products%20By%20The%20Date.sql)\n    - [1517. Find Users With Valid E-Mails](./leetcode/easy/1517.%20Find%20Users%20With%20Valid%20E-Mails.sql)\n    - [1527. Patients With a Condition](./leetcode/easy/1527.%20Patients%20With%20a%20Condition.sql)\n    - [1581. Customer Who Visited but Did Not Make Any Transactions](./leetcode/easy/1581.%20Customer%20Who%20Visited%20but%20Did%20Not%20Make%20Any%20Transactions.sql)\n    - [1587. Bank Account Summary II](./leetcode/easy/1587.%20Bank%20Account%20Summary%20II.sql)\n    - [1633. Percentage of Users Attended a Contest](./leetcode/easy/1633.%20Percentage%20of%20Users%20Attended%20a%20Contest.sql)\n    - [1661. Average Time of Process per Machine](./leetcode/easy/1661.%20Average%20Time%20of%20Process%20per%20Machine.sql)\n    - [1667. Fix Names in a Table](./leetcode/easy/1667.%20Fix%20Names%20in%20a%20Table.sql)\n    - [1683. Invalid Tweets](./leetcode/easy/1683.%20Invalid%20Tweets.sql)\n    - [1693. Daily Leads and Partners](./leetcode/easy/1693.%20Daily%20Leads%20and%20Partners.sql)\n    - [1729. Find Followers Count](./leetcode/easy/1729.%20Find%20Followers%20Count.sql)\n    - [1731. The Number of Employees Which Report to Each Employee](./leetcode/easy/1731.%20The%20Number%20of%20Employees%20Which%20Report%20to%20Each%20Employee.sql)\n    - [1741. Find Total Time Spent by Each Employee](./leetcode/easy/1741.%20Find%20Total%20Time%20Spent%20by%20Each%20Employee.sql)\n    - [1789. Primary Department for Each Employee](./leetcode/easy/1789.%20Primary%20Department%20for%20Each%20Employee.sql)\n    - [1795. Rearrange Products Table](./leetcode/easy/1795.%20Rearrange%20Products%20Table.sql)\n    - [1873. Calculate Special Bonus](./leetcode/easy/1873.%20Calculate%20Special%20Bonus.sql)\n    - [1890. The Latest Login in 2020](./leetcode/easy/1890.%20The%20Latest%20Login%20in%202020.sql)\n    - [1965. Employees With Missing Information](./leetcode/easy/1965.%20Employees%20With%20Missing%20Information.sql)\n    - [1978. Employees Whose Manager Left the Company](./leetcode/easy/1978.%20Employees%20Whose%20Manager%20Left%20the%20Company.sql)\n    - [2356. Number of Unique Subjects Taught by Each Teacher](./leetcode/easy/2356.%20Number%20of%20Unique%20Subjects%20Taught%20by%20Each%20Teacher.sql)\n    - [3436. Find Valid Emails](./leetcode/easy/3436.%20Find%20Valid%20Emails.sql)\n2. [Medium](./leetcode/medium/)\n    - [176. Second Highest Salary](./leetcode/medium/176.%20Second%20Highest%20Salary.sql)\n    - [180. Consecutive Numbers](./leetcode/medium/180.%20Consecutive%20Numbers.sql)\n    - [184. Department Highest Salary](./leetcode/medium/184.%20Department%20Highest%20Salary.sql)\n    - [550. Game Play Analysis IV](./leetcode/medium/550.%20Game%20Play%20Analysis%20IV.sql)\n    - [570. Managers with at Least 5 Direct Reports](./leetcode/medium/570.%20Managers%20with%20at%20Least%205%20Direct%20Reports.sql)\n    - [585. Investments in 2016](./leetcode/medium/585.%20Investments%20in%202016.sql)\n    - [602. Friend Requests II: Who Has the Most Friends](./leetcode/medium/602.%20Friend%20Requests%20II:%20Who%20Has%20the%20Most%20Friends.sql)\n    - [626. Exchange Seats](./leetcode/medium/626.%20Exchange%20Seats.sql)\n    - [1045. Customers Who Bought All Products](./leetcode/medium/1045.%20Customers%20Who%20Bought%20All%20Products.sql)\n    - [1070. Product Sales Analysis III](./leetcode/medium/1070.%20Product%20Sales%20Analysis%203.sql)\n    - [1158. Market Analysis 1](./leetcode/medium/1158.%20Market%20Analysis%201.sql)\n    - [1164. Product Price at a Given Date](./leetcode/medium/1164.%20Product%20Price%20at%20a%20Given%20Date.sql)\n    - [1174. Immediate Food Delivery II](./leetcode/medium/1174.%20Immediate%20Food%20Delivery%20II.sql)\n    - [1193. Monthly Transactions I](./leetcode/medium/1193.%20Monthly%20Transactions%20I.sql)\n    - [1204. Last Person to Fit in the Bus](./leetcode/medium/1204.%20Last%20Person%20to%20Fit%20in%20the%20Bus.sql)\n    - [1321. Restaurant Growth](./leetcode/medium/1321.%20Restaurant%20Growth.sql)\n    - [1341. Movie Rating](./leetcode/medium/1341.%20Movie%20Rating.sql)\n    - [1907. Count Salary Categories](./leetcode/medium/1907.%20Count%20Salary%20Categories.sql)\n    - [1934. Confirmation Rate](./leetcode/medium/1934.%20Confirmation%20Rate.sql)\n3. [Hard](./leetcode/hard/)\n    - [185. Department Top Three Salaries](./leetcode/hard/185.%20Department%20Top%20Three%20Salaries.sql)\n\n## Contributing\n\nStyle guide for contributors:\n\n1. Add description to all tasks from Leetcode.\n2. Name file pattern: xxx.Task name.sql\n3. All keywords must be uppercase.\n4. For every task create new branch with pattern: task/task-id -\u003e make PR to main.\n\nHave a good contributing!\n\n## License\n\nCheck out LICENSE [page](./LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanbyone%2Fawesome-leetcode-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivanbyone%2Fawesome-leetcode-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanbyone%2Fawesome-leetcode-sql/lists"}