select device_id,university,gpa from 
(select device_id,university,gpa,(row_number() over (partition by university order by university,gpa)) as 'rank'
from user_profile) as A
where A.rank = "1";