DrawCode Practice Problem

Top Customers by Revenue

Given `orders(order_id, customer_id, amount)` and `customers(customer_id, name)`, write a query returning the top 5 customers by total revenue with their names.

Examples

Input

orders joined to customers

Output

name, total_revenue ordered desc limit 5

Constraints


Interactive Visualizer Workspace

Explore step-by-step interactive animations, memory state tracking, and live multi-language execution in DrawCode.

Launch Interactive Visualizer