select device_id,university,gpa from (select device_id,university,gpa, row_number() over (partition by university order by gpa) as ranking from user_profile ) as rk where ranking=1;