BEAT 96% , MY SQL
IntuitionApproachSUB QUERYComplexity
Time complexity:
It should be O(n^2) due to count being used for all n records

Space complexity:
O(n) to add a new column
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->
SUB QUERY

# Complexity
- Time complexity: 
  It should be O(n^2) due to count being used for all n records
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
 O(n) to add a new column students
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```mysql []

SELECT class FROM (
    SELECT class, COUNT(class) as "students" FROM courses
    GROUP BY class
) AS tab
WHERE students>4;
```
['MySQL']