with rank_table as(
    select 
        device_id,
        university,
        gpa ,
        rank() over(partition by university order by gpa) as rank_
    from user_profile
)
select 
    device_id ,
    university ,
    gpa
from rank_table
where rank_ =1;