1.首先题目肯定是按工作分组了,那么语句肯定是如下的:
select xxx from grade group by job然后知道分组之后的分数和是
sum(score)求平均数就是
round(sum(score)*1.0/count(id),3) as avg联合再按avg降序排序为:
select job,round(sum(score)*1.0/count(id),3) as avg from grade group by job order by avg desc;
select xxx from grade group by job然后知道分组之后的分数和是
sum(score)求平均数就是
round(sum(score)*1.0/count(id),3) as avg联合再按avg降序排序为:
select job,round(sum(score)*1.0/count(id),3) as avg from grade group by job order by avg desc;