Loading…
Find the top 5 customers by total revenue using a CTE.
Think about this in two steps:
Your CTE needs to join three tables to get from customers → orders → individual items:
customers ←→ orders ←→ orderItems
name status quantity × unitPrice = revenue
Downloading SQL engine… (one-time)
This runs entirely in your browser and is cached for next time.