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

book
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

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

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 3. Kapitel 12

Query ResultQuery Result
No query executed yet...

Fråga AI

expand
ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

some-alt