79153323

Date: 2024-11-03 17:59:04
Score: 0.5
Natty:
Report link

I think the answer is much more simple ;

SELECT s.name, MAX(t.score) as topScore, t.day AS topScoreDay
FROM student as s
LEFT JOIN testScore AS t ON s.id = t.studentId
GROUP BY s.id
ORDER BY topScore DESC, t.score ASC;

Result :

name topScore topScoreDay
steve 100 5
joe 95 15
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Mike