Challenge Having
Uppgift
Swipe to start coding
Let's find the total value of each album with more than 1 song. To do that, you should group songs by their albums and count the total price of songs. Display the album
, the number of songs in it, and the price of the album, starting with the most expensive.
Lösning
9
1
2
3
4
5
select album, count(id), sum(price)
from songs
group by album
having count(id)>1
order by sum(price) desc
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 3. Kapitel 12
9
1
No query executed yet... |
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal