Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script Changed #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Imran-imtiaz48
Copy link

descriptions for all three queries:

Best-Selling Artist by Customer:

We created a CTE (best_selling_artist) to calculate the total amount spent on tracks associated with each artist. Then, we joined this CTE with other tables to get customer information and their spending on tracks from the best-selling artists, grouping by customer and artist, and ordered by total spending in descending order.
Most Popular Genre by Country:

We created a CTE (popular_genre) to calculate the number of purchases per genre for each country, assigning a row number based on the number of purchases in descending order. The main query then selected the country, genre name, and number of purchases for the most popular genre in each country.
Top-Spending Customer by Country:

We created a CTE (customer_with_country) to calculate the total amount spent by each customer and assigned a row number based on the total spent within each billing country. The main query selected the customer details for the highest-spending customer in each country.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant