* Problem
Write a solution to find all the classes that have at least five students.
Return the result table in any order.
* Explanation
- Math has 6 students, so we include it.
- English has 1 student, so we do not include it.
- Biology has 1 student, so we do not include it.
- Computer has 1 student, so we do not include it.
* Solution (Success)
SELECT class
FROM Courses
GROUP BY 1
HAVING COUNT(*) >= 5;
'Study - Problems(IT) > LeetCode - SQL' 카테고리의 다른 글
619.Biggest Single Number (0) | 2024.11.25 |
---|---|
1729.Find Followers Count (0) | 2024.11.24 |
1070. Product Sales Analysis 3 (0) | 2024.11.22 |
1141.User Activity for the Past 30 Days I (1) | 2024.11.21 |
2356.Number of Unique Subjects Taught by Each Teacher (0) | 2024.11.20 |