select
    t.device_id,
    t.university,
    gpa
from
    (
        select distinct
            device_id,
            university,
            rank() over (
                partition by
                    university
                order by
                    gpa
            ) as rk,
            gpa
        from
            user_profile
    ) t
    where t.rk=1