Challenge: the Biggest Album
Oppgave
Swipe to start coding
Find the album's title (title
) with a maximum number of songs (count id
s). If there are multiple answers, select the first one from sorted in the lexicographical order.
Løsning
9
1
2
3
4
5
6
7
SELECT albums.title, COUNT(songs.id)
FROM albums
INNER JOIN songs
ON songs.album_id = albums.id
GROUP BY albums.id
ORDER BY count(songs.id) DESC, albums.title
LIMIT 1
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 3. Kapittel 2
single
9
1
2
SELECT _ _ _
FROM _ _ _
No query executed yet... |
Spør AI
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