Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge Having | Filtering Statements
SQL Tutorial for Beginners

book
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

select album, count(id), sum(price)
from songs
group by album
having count(id)>1
order by sum(price) desc

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 12

Query ResultQuery Result
No query executed yet...

Spør AI

expand
ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

some-alt