Challenge Having
Oppgave
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
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 3. Kapittel 12
9
1
No query executed yet... |
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår