Q3 Med

mail@pastecode.io avatar
unknown
mysql
2 years ago
217 B
1
Indexable
Never
SELECT (CASE g.grade>=8 WHEN TRUE THEN s.name 
       ELSE NULL END), g.grade, s.marks FROM students s
       INNER JOIN grades g ON s.marks BETWEEN min_mark AND max_mark
       ORDER BY g.grade DESC, s.name, s.marks;