select device_id,university,gpa from ( select device_id,university,gpa, row_number() over(partition by university order by gpa ) rn from user_profile) a where rn =1;