Added table to the ranking sql