- Published on
Leetcode - 580. Count Student Number in Departments
- Authors
- Name
- Indo Yoon
Table of Contents
문제
[Loading...
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
](https://leetcode.com/problems/count-student-number-in-departments/)
정답
SELECT Department.dept_name, COUNT(Student.dept_id) AS student_number
FROM Student
RIGHT JOIN Department ON Student.dept_id = Department.dept_id
GROUP BY Department.dept_name
ORDER BY student_number DESC, dept_name