Challenge: Rating of Singers
Tâche
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.
Solution
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
Tout était clair ?
Merci pour vos commentaires !
Section 3. Chapitre 3
9
1
SELECT _ _ _
No query executed yet... |
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion