Sales of Genres in Cities
Task
Swipe to start coding
Which genre gives the biggest income in each city? To solve it:
- Calculate the total sales for each genre in each city: group records by city and genre.
- Order the records by city lexicographically and then by total sales, starting with most selling genre.
Output data under columns city
, genre
, and sales
.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 2. ChapterΒ 6
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Summarize this chapter
Explain the code in file
Explain why file doesn't solve the task
Awesome!
Completion rate improved to 4.55
Sales of Genres in Cities
Swipe to show menu
Task
Swipe to start coding
Which genre gives the biggest income in each city? To solve it:
- Calculate the total sales for each genre in each city: group records by city and genre.
- Order the records by city lexicographically and then by total sales, starting with most selling genre.
Output data under columns city
, genre
, and sales
.
Solution
Everything was clear?
Thanks for your feedback!
Awesome!
Completion rate improved to 4.55SectionΒ 2. ChapterΒ 6
single