id | name | groups | student |
id | score | class | score |
1 | 刘备 | A |
2 | 关羽 | A |
3 | 张飞 | A |
4 | 赵云 | B |
5 | 马超 | B |
6 | 黄忠 | C |
1 | 100 | A |
2 | 90 | A |
3 | 90 | A |
4 | 80 | B |
5 | 70 | B |
6 | 60 | C |
查询每组,每班的平均成绩 select s.groups,class,avg(score) from score sc join student s on sc.id=s.id group by s.groups, class;
查询成绩前三名的学生,成绩相同随机取名字 select * from score sc join student s on sc.id=s.id group by score order by score desc limit 3;
點擊查看更多內容
為 TA 點贊
評論
評論
共同學習,寫下你的評論
評論加載中...
作者其他優質文章
正在加載中
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦