mahir_data
hardMaybank · windowPro

Rank customers by spend

Maybank wants a leaderboard of its biggest spenders.

Join customers to transactions and return each customer's name, their total spend as total_spent, and their rank as spending_rank where 1 is the highest spender (rank by total spend, highest first). Assume no two customers have the same total.

Schema

customers
idINT
nameTEXT
transactions
idINT
customer_idINT
amountNUMERIC(10,2)

Pro

The example input, expected output, and walkthrough for this question unlock with a Pro plan.

Pro

This is a Pro question

Premium practice questions unlock with a Pro plan. The full solution, expected output, and grading are available to Pro members.

See Pro plans