MariaDB [hellodb]> select name,avg(score) from students as st,scores as sc,courses as co where st.stuid=sc.stuid and sc.courseid=co.courseid group by st.name order by avg(score) desc limit 3;
+-------------+------------+
| name | avg(score) |
+-------------+------------+
| Shi Qing | 96.0000 |
| Shi Zhongyu | 85.0000 |
| Xi Ren | 84.5000 |
+-------------+------------+