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

602. Friend Requests II – Who Has the Most Friends in SQL? πŸ”

kvi5hnu13 minutes 19 secondsWatch on YouTube
0comments

Notes

In this video, we solve the "Friend Requests II: Who Has the Most Friends" problem from LeetCode using MySQL. Learn how to find the user with the most number of accepted friend requests β€” including handling ties using a clean, multi-step approach.

πŸ“Œ What You’ll Learn in This Video:
βœ… Using UNION ALL to combine rows across multiple columns
βœ… Counting total friends by grouping IDs
βœ… Finding the max count of friends using subqueries or CTEs
βœ… Handling ties using modern SQL techniques
βœ… Writing clean and readable SQL queries for interview-style questions

πŸ”— LeetCode Problem:
https://leetcode.com/problems/friend-requests-ii-who-has-the-most-friends

πŸ”₯ If you found this video helpful, don’t forget to:
πŸ‘ Like the video to support the channel
πŸ’¬ Drop your thoughts or questions in the comments
πŸ”” Subscribe & turn on notifications for more SQL content!

Let’s master SQL together! πŸš€

#SQL #MySQL #LeetCode #FriendRequests #LeetCodeSQL #SQLQueries #DataAnalytics #SQLInterview #TopSQLQuestions #LearnSQL #SoftwareEngineering #Database #SQLShorts #sql50

Discussion

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