Usa aggregazione condizionale con CASE:
select s.id, avg(case when sb.id = '01' then s.score end) as math, avg(case when sb.id = '02' then s.score end) as bio from student s join subject sb on sb.id = s.subject_id group by s.idOgni CASE restituisce il punteggio solo per la propria materia. Scegli avg o sum in base al dato.