WITH grade_count AS ( SELECT job, COUNT(job) AS job_cnt FROM grade GROUP BY job ), grade_rank AS ( SELECT id, job, score, DENSE_RANK() OVER ( PARTITION BY job ORDER BY score DESC) AS d_rank FROM grade ORDER BY id ASC ) SELECT r.id, r.job, r.score, r.d_rank FROM grade...