create a query that will result in one row per each customer, with their name, email, and total amount of money they've spent on orders. Sort the rows according to the total money spent, from the most spent to the least spent.
SELECT customers.name, customers.email, orders.id, + orders.price as [total] FROM customers JOIN orders ON customers.id = orders.customer_id GROUP BY total;
What you said you are looking for one record per customer you would need to remove orders.id and not group by total
SELECT customers.name, customers.email, SUM(orders.price) as [total]
FROM customers
JOIN orders ON customers.id = orders.customer_id
GROUP BY customers.name, customers.email;