602. Friend Requests II β Who Has the Most Friends in SQL? π
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.