EasyOutput prediction
Sort grouped results by aggregate value
Given this table (orders):
| id | customer | amount |
|---|---|---|
| 1 | Alice | 100 |
| 2 | Bob | 400 |
| 3 | Alice | 200 |
| 4 | Carol | 150 |
What does this query return?
SELECT customer, SUM(amount) AS total FROM orders GROUP BY customer ORDER BY total DESC;
← → arrow keys to navigate
Sign in to save your progress.