select device_id,university,gpa from 
(select device_id,university,gpa
,rank() over(partition by university order by gpa) as rnk
from user_profile) a 
where rnk = 1 
order by university