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