Sql Rank Function Practice Javascript Problems