[https://www.sqlitetutorial.net/sqlite-sample-database/]
I wrote this code to get the answer to 'What is the total price for the album “Big Ones”?'
SELECT al.Title, i.Total, tr.albumid, SUM(tr.UnitPrice)
FROM ((((artists ar INNER JOIN albums al ON ar.ArtistId = al.ArtistId)
INNER JOIN tracks tr ON al.AlbumId = tr.AlbumId)
INNER JOIN invoice_items ii ON tr.TrackId = ii.TrackId)
INNER JOIN invoices i ON ii.invoiceid = i.invoiceid)
WHERE al.Title = 'Big Ones'
I got the SUM(tr.UnitPrice)
as 9.9
.
But 9.9 is wrong. What should be the correct answer?
Tables from Chinook database is used. The link is provided above.