Bitte schauen Sie sich Abschnitt 13, Thema 232 genauer an.
SELECT
first_name,
last_name,
IFNULL(SUM(amount), 0) AS money_spent
FROM
customers
LEFT JOIN
orders ON customers.id = orders.customer_id
GROUP BY first_name , last_name;
SQL