Customers Spending Above Their Country's Average

medium
Unit 16 · Window Functions IX0/2 to milestone

Among customers with orders, return name, country, spend and country_avg (the average spend of buying customers in the same country, rounded to 2 decimals) for those whose spend is strictly above their country's average. Sort by country, then spend descending.

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
query.sql · SQLite
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Customers Spending Above Their Country's Average · TechGradify