Music-SQL-Database

For the Business Analytics Nanodegree offered by Udacity, I had to submit a project where I would use SQL queries to analyze the Chinook Music Database and answer at least these 3 questions:

  1. I had to find out the most popular music Genre for each country, determine the most popular genre as the genre with the highest amount of purchases, write a query that returns each country along with the top Genre. For countries where the maximum number of purchases is shared return all Genres. For this query, I had to use the Invoice, InvoiceLine, Customer, Track, and Genre tables.
  2. Return all the track names that have a song length longer than the average song length. Though I could perform this with two queries. Imagine you wanted your query to update based on when new data is put in the database. Therefore, you do not want to hard code the average into your query. You only need the Track table to complete this query. Return the Name and Milliseconds for each track. Order by the song length with the longest songs listed first.
  3. Write a query that determines the customer that has spent the most on music for each country. Write a query that returns the country along with the top customer and how much they spent. For countries where the top amount spent is shared, provide all customers who spent this amount. You should only need to use the Customer and Invoice tables.

The presentation should include:

  • Four slides
  • One visualization per slide
  • A 1-2 sentence explanation of each slide
  • The SQL query used to create the data used in the visualization.