Write SQL for rankings, state, and aggregations | LinkedIn SQL Question