Easy and Simple Solution
Please Like ❤️IntuitionWe need to find classes that have at least 5 students.Approach
Group students by class using GROUP BY class.
Count the number of students
```mysql
# Write your MySQL query statement below
SELECT class
FROM Courses
GROUP BY class
HAVING COUNT(class) >= 5;
```

# Please Like ❤️  
![Please Like](https://media.tenor.com/heEyHbV8iaUAAAAM/puss-in-boots-shrek.gif)  

# Intuition  
We need to find classes that have at least 5 students.

# Approach  
1. **Group students by `class`** using `GROUP BY class`.  
2. **Count the number of students in each class** using `COUNT(class)`.  
3. **Filter classes** with at least 5 students using `HAVING COUNT(class) >= 5`.  

# Complexity  
- **Time Complexity:** $$O(n)$$ – We scan all records once and aggregate them.  
- **Space Complexity:** $$O(1)$$ – We only store the result temporarily.
['MySQL']