Loading...
Above the Curve
A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- medium
Problem
The growth team is building a high-value customer segment for a targeted campaign. Compute each user's total spend across all transactions, then surface only users whose total exceeds the average spend. For each qualifying user, show their ID, total spend, and how far above the average they land. Present them sorted from biggest spender to smallest.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a live PostgreSQL database and grades it instantly.