79

Top Customer per City

Hardwindow functionRANKsubquery

Problem Description

Write a SQL query to find the customer who spent the most in each city.

Expected Columns

  • city
  • customer_name
  • total_spent

Example Output

| city | customer_name | total_spent | |------|---------------|-------------| | Ahmedabad | Geeta Patel | 1150.0 | | Bangalore | Amit Sharma | 5300.0 | | ... | ... | ... |

Hints

Unlocks after 2 more attempts
Submit your solution to unlock hints
//#79 Top Customer per City
Hard

Loading schema...

Loading editor...

No results yet

Run a query to see results