leetcodeSQL:统计各专业学生人数

leetcodeSQL:统计各专业学生人数
思路:
简单left join + groupby + orderby

sql

# Write your MySQL query statement below
select dept_name, count(student_id) student_number
from Department t left join Student s 
on s.dept_id = t.dept_id
group by t.dept_name
order by student_number DESC, dept_name ASC
上一篇:Aviator简介


下一篇:aviator表达式默认支持函数