select b.name, a.cnt from (select subject_id, count(subject_id) as "cnt" from submission where create_time=current_date() group by subject_id) a join subject b on a.subject_id=b.id order by cnt desc, a.subject_id;