Menu
CodeSprout
Typo-tolerant search across every article, problem and post. to open

🚌 Last Person to Fit in the Bus | MySQL SQL Query Explained πŸš€

kvi5hnu9 minutes 49 secondsWatch on YouTube
0comments

Notes

In this video, we solve the "Last Person to Fit in the Bus" problem from LeetCode using MySQL. We walk through how to calculate the cumulative sum of weights and determine the last person who can board without exceeding the weight limit.

πŸ“Œ What You’ll Learn in This Video:
βœ… How to use Common Table Expressions (CTEs) in SQL
βœ… Calculating cumulative sums with subqueries
βœ… Using ORDER BY DESC and LIMIT to find the correct result
βœ… Writing efficient SQL queries for real-world scenarios

πŸ”— LeetCode Problem: https://leetcode.com/problems/last-person-to-fit-in-the-bus

πŸ”₯ If you found this video helpful, don’t forget to:
πŸ‘ Like the video to support the channel
πŸ’¬ Comment below with your questions or improvements
πŸ”” Subscribe & turn on notifications for more SQL tutorials!

Let's master SQL together! πŸš€

#SQL #MySQL #LeetCode #SQLQueries #Database #CodingInterview #LeetCodeSQL #DataAnalysis #LearnSQL #SoftwareEngineering

Discussion

Sign in to ask a question or share what you learned.