Loading...

Spending Range

A hard SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.

Domain
SQL
Difficulty
hard

Problem

Data science is modeling per-user spending variability and needs the minimum and maximum transaction amount for each user who has more than one transaction. Show the username, min amount, max amount, and the range, sorted from widest range to narrowest.

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.