Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📊 LeetCode SQL 50

LeetCode SQL 50 Automation Language


📈 The scoreboard

This table is auto-generated — don't edit it by hand, it'll just get overwritten anyway 🙂

LeetCode SQL Practice (20)
# Problem Link
1 AverageTimeofProcessperMachine Code
2 RisingTemperature Code
3 GamePlayAnalysisIV Code
4 ManagerswithatLeast5DirectReports Code
5 FindCustomerReferee Code
6 BigCountries Code
7 NotBoringMovies Code
8 ProductSalesAnalysisI Code
9 ProjectEmployeesI Code
10 ArticleViewsI Code
11 ImmediateFoodDeliveryII Code
12 MonthlyTransactionsI Code
13 QueriesQualityandPercentage Code
14 AverageSellingPrice Code
15 ReplaceEmployeeIDWithTheUniqueIdentifier Code
16 CustomerWhoVisitedbutDidNotMakeAnyTransactions Code
17 PercentageofUsersAttendedaContest Code
18 InvalidTweets Code
19 RecyclableandLowFatProducts Code
20 ConfirmationRate Code

👋 What's this?

This is my little SQL gym. I'm working through LeetCode's Top SQL 50 study plan, one query at a time, and dumping every solution here so I can watch the progress add up.

I'm not just trying to get a green checkmark — I actually enjoy the puzzle of it. How do you write a query that's not just correct, but clean, fast, and doesn't make the database cry? That's the fun part for me: joins, window functions, aggregations, all of it.


⚙️ How it stays up to date (without me lifting a finger)

I got a little lazy about manually updating a table every time I add a solution, so I automated it:

  1. I drop a new .sql file into /solutions/.
  2. I push it to GitHub.
  3. A GitHub Action wakes up, runs generate_table.py, and it scans the folder, figures out the problem number and name from the filename, and rebuilds the table below.
  4. It commits the updated README right back to the repo. No copy-pasting, no forgetting to update a count.
📂 repository-root
├── 📂 .github/workflows/    # the robot that runs the script on every push
├── 📂 solutions/            # all my actual .sql answers live here
├── 📄 generate_table.py     # reads the folder, writes the table below
└── 📄 README.md             # you are here

🛠️ Want to run this yourself?

If you're forking this to track your own SQL grind, here's the one rule that matters: name your files like this

[ProblemNumber].[ProblemNameNoSpaces].sql

1757.RecyclableandLowFatProducts.sql1757_recyclable_products.sql (wrong separator) ❌ 1757.sql (needs a name too)

Then just run:

python generate_table.py

and check the README updated itself.

Two things not to touch: the <!-- leetcode_sql:START --> / <!-- leetcode_sql:END --> comments — those are how the script knows where to inject the table. And keep all your .sql files directly inside /solutions/, not in subfolders.

That's it — happy querying! 🐘

About

I'm working through LeetCode's Top SQL 50 study plan, one query at a time, and dumping every solution here so I can watch the progress add up.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages