문제) Leetcode - SQL - Classes More Than 5 Students
https://leetcode.com/problems/classes-more-than-5-students/
Classes More Than 5 Students - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
학생 수가 5명 이상인 수업을 고르는 문제였습니다. group by를 통해 수업 별로 묶은 후, count를 통해 학생 수를 계산합니다.
풀이)
select class
from courses
group by class
having count(student) >= 5
반응형
'Develop > Database' 카테고리의 다른 글
[프로그래머스] SQL 고득점 Kit - 보호소에서 중성화한 동물 (MySQL) 문제 및 풀이 (0) | 2022.01.03 |
---|---|
[프로그래머스] SQL 고득점 Kit - 중성화 여부 파악하기 (MySQL) 문제 및 풀이 (0) | 2021.12.30 |
[Leetcode] 620. Not Boring Movies (MySQL) 문제 및 풀이 (0) | 2021.12.23 |
[Leetcode] 595. Big Countries (MySQL) 문제 및 풀이 (0) | 2021.12.22 |
[Leetcode] 197. Rising Temperature (MySQL) 문제 및 풀이 (0) | 2021.12.20 |
댓글