select up.device_id,up.university,up.gpa
from user_profile up
inner join (
    select university,min(gpa) min_gpa
    from user_profile
    group by university
) up1
on up.university = up1.university
and up.gpa = up1.min_gpa
order by up.university