migrating to sql for rank information