The international marketing team needs to know the most popular music genre in each country by purchase count. This will help localize advertising campaigns.
| Column | Type |
|---|---|
| InvoiceId | INTEGER (Primary Key) |
| CustomerId | INTEGER (Foreign Key → Customer.CustomerId) |
| InvoiceDate | TIMESTAMP |
| BillingAddress | TEXT |
| BillingCity | TEXT |
| BillingState | TEXT |
| BillingCountry | TEXT |
| BillingPostalCode | TEXT |
| Total | NUMERIC(10,2) |
| Column | Type |
|---|---|
| GenreId | INTEGER (Primary Key) |
| Name | TEXT |
ROW_NUMBER() partitioned by country, ordered by count descendingCountry, GenreName, PurchaseCountReady to take your skills to the next level? Enroll in our comprehensive Data Analyst Career Track to master SQL, Python, Excel, and Power BI.
Run your code to see the result here.