Revenue per artist

Money time. Each row of invoice_lines is one song sold, with a quantity and a unit_price. Follow the chain invoice_lines → tracks → albums → artists and compute total revenue per artist — SUM(quantity * unit_price), rounded to 2 decimals, in a column called revenue. One row per artist name. (Artists with no sales quietly disappear with inner joins — that's fine for now.)

Tables in this exercise
artists
id name country formed_year
albums
id title artist_id release_year
tracks
id title album_id genre_id duration_sec unit_price
invoice_lines
id invoice_id track_id quantity unit_price

Back to the chapter