101
0/304
Loading content...
You are given a Courses table where each row represents one enrollment record.
Columns:
The pair (student, class) is unique, so a student cannot be duplicated within the same class.
Task: Return every class that has at least 5 enrolled students.
Output requirements:
Supported submission environments:
Courses:
| student | class |
|---------|----------|
| A | Math |
| B | English |
| C | Math |
| D | Biology |
| E | Math |
| F | Computer |
| G | Math |
| H | Math |
| I | Math |[
{"class":"Math"}
]Math has 6 students, so it is included. Other classes have fewer than 5 enrollments.
Courses:
| student | class |
|---------|----------|
| S1 | Data101 |
| S2 | Data101 |
| S3 | Data101 |
| S4 | Data101 |
| S5 | Data101 |
| S6 | Networks |
| S7 | Networks |
| S8 | Networks |[
{"class":"Data101"}
]Data101 meets the threshold exactly with 5 enrollments. Networks has only 3.
Courses:
| student | class |
|---------|----------|
| U1 | Physics |
| U2 | Physics |
| U3 | History |
| U4 | Art |[]No class reaches 5 enrollments.
Constraints