Back to Browse

LeetCode 596 - Classes More Than 5 Students (Python and SQL) [EASY]

371 views
Mar 19, 2024
5:20

🧠 Don’t miss out! Get FREE access to my Skool community — packed with resources, tools, and support to help you with Data, Machine Learning, and AI Automations! 📈 https://www.skool.com/data-and-ai-automations-4579 Learn to solve Leetcode question 596, Classes More Than 5 Students: https://leetcode.com/problems/classes-more-than-5-students/description/ 🚀 Hire me for Data Work: https://ryanandmattdatascience.com/data-freelancing/ 👨‍💻 Mentorships: https://ryanandmattdatascience.com/mentorship/ 📧 Email: [email protected] 🌐 Website & Blog: https://ryanandmattdatascience.com/ 🖥️ Discord: https://discord.com/invite/F7dxbvHUhg 📚 *Practice SQL & Python Interview Questions: https://stratascratch.com/?via=ryan 📖 *SQL and Python Courses: https://datacamp.pxf.io/XYD7Qg 🍿 WATCH NEXT LeetCode Playlist: https://www.youtube.com/playlist?list=PLcQVY5V2UY4J_wlwSXiEuf2KrEBan0Ysv LeetCode 584: https://youtu.be/WcA9WSSNVLM LeetCode 577: https://youtu.be/30QW8MYxelw LeetCode 183: https://youtu.be/M0SK08bDHPU Learn how to solve LeetCode 596 "Classes More Than Five Students" in both SQL and Python pandas with this complete step-by-step tutorial. In this video, I walk through finding all classes that have at least five students, breaking down the solution line by line in both languages. We start with the SQL solution using GROUP BY and the HAVING clause to filter grouped results, which is a cleaner approach than using CTEs for this problem. Then I show you the Python pandas approach, demonstrating how to use groupby(), count(), and filtering techniques to achieve the same result. This is a great beginner-friendly problem that teaches you fundamental data manipulation skills used in real data analyst and data engineer interviews. Whether you're preparing for technical interviews or just want to improve your SQL and pandas skills, this tutorial covers everything you need to know about grouping data and applying aggregate filters. By the end of this video, you'll understand when to use HAVING versus WHERE in SQL and how to create filtered dataframes in pandas. If you found this helpful, subscribe for 2-3 new data-focused tutorials every week covering LeetCode problems, SQL, Python, and data science concepts! TIMESTAMPS 00:00 Introduction & Problem Overview 00:50 SQL Solution - Setup 01:40 SQL Solution - Group By & Having Clause 02:30 Testing SQL Solution 02:50 Python Pandas Solution - Creating Course Total 03:50 Python Pandas Solution - Filtering & Return 04:20 Solution Review & Explanation OTHER SOCIALS: Ryan’s LinkedIn: https://www.linkedin.com/in/ryan-p-nolan/ Matt’s LinkedIn: https://www.linkedin.com/in/matt-payne-ceo/ Twitter/X: https://x.com/RyanMattDS Who is Ryan Ryan is a Data Scientist at a fintech company, where he focuses on fraud prevention in underwriting and risk. Before that, he worked as a Data Analyst at a tax software company. He holds a degree in Electrical Engineering from UCF. Who is Matt Matt is the founder of Width.ai, an AI and Machine Learning agency. Before starting his own company, he was a Machine Learning Engineer at Capital One. *This is an affiliate program. We receive a small portion of the final sale at no extra cost to you.

Download

1 formats

Video Formats

360pmp48.2 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

LeetCode 596 - Classes More Than 5 Students (Python and SQL) [EASY] | NatokHD