Aggregation & GROUP BY
Exercise · SQL & Querying

Predict, then run it

Predict the output

artists(artist) = Mo, Vee. sessions(artist, minutes) = (Mo,90),(Mo,45); Vee has none yet. The invoice run needs every artist, new ones at 0:

SELECT a.artist, COALESCE(SUM(s.minutes), 0) AS total FROM artists a LEFT JOIN sessions s ON s.artist = a.artist GROUP BY a.artist ORDER BY a.artist;

Predict the exact output.