dblabs/n.sql

7 lines
285 B
MySQL
Raw Normal View History

2024-01-25 19:40:23 +01:00
select Students.firstName, max(averageGrade) as maxAverage
from (
select Students.pNbr, TakenCourses.grade, avg(grade) as averageGrade
from Students
join TakenCourses on Students.pNbr = TakenCourses.pNbr
group by Students.pNbr
) as studentAverages