Challenge: Rating of Singers
Tehtävä
Swipe to start coding
Create a rating of the singers: from singer with the biggest average Song's price to the smallest one. Output the singer's name (naming
) and avearge price (price
) of his/her songs.
Ratkaisu
9
1
2
3
4
5
6
SELECT singers.naming, AVG(songs.price)
FROM singers
INNER JOIN songs
ON songs.singer_id = singers.id
GROUP BY singers.id
ORDER BY AVG(songs.price) DESC
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 3. Luku 3
single
9
1
SELECT _ _ _
No query executed yet... |
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme