Coder Social home page Coder Social logo

music_store-sql-data-exploration_projectn-'s Introduction

Chinook Database

Introduction
In this project, I queried the Chinook Database. The Chinook Database holds information about a music store. For this project, I will be assisting the Chinook team with understanding the media in their store, their customers and employees, and their invoice information. To assist in the queries ahead, the schema for the Chinook Database is provided below. You can see the columns that link tables together via the arrows.

Project PK and FK

My presentation includes:
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.

Visualization: sql-project-submission-template-1.pptx

Queries used for my Project:

  1. /*Query 1 - query used to get amount spent by customers per country on any album by U2/
SELECT c.Country, SUM(il.Quantity)*il.UnitPrice AS Amount,
FROM Artist ar
JOIN Album a
ON a.ArtistId = ar.ArtistId
JOIN Track t
ON a.AlbumId = t.AlbumId
JOIN InvoiceLine il
ON il.trackId = t.trackId
JOIN Invoice i
ON i.InvoiceId = il.InvoiceId
JOIN Customer c
ON c.CustomerId = i.CustomerId
WHERE ar.name= "U2"
GROUP By c.Country, ar.name
ORDER BY Amount DESC
LIMIT 10
  1. /Query 2- query used to obtain top 5 playlists with highest amount of Purchase/
SELECT p.Name, COUNT(i.InvoiceId) AS Purchases\
JOIN PlayListTrack pt\
ON pt.PlaylistId = p.PlaylistId\
JOIN Track t\
ON t.TrackId = pt.TrackId\
JOIN InvoiceLine il\
ON il.TrackId = t.TrackId\
JOIN Invoice i\
ON i.InvoiceId = il. InvoiceId\
JOIN Customer c\
ON i.CustomerId = c.CustomerId\
GROUP BY p.Name\
ORDER BY Purchases DESC\
LIMIT 5
  1. /Query 3- query used to know the total amount spent per genre in Berlin, Germany/
SELECT g.name AS Genres, Sum(i.Total) Total_spent, c.city\
FROM Customer c\
JOIN Invoice i\
ON i.CustomerId = c.CustomerId\
JOIN InvoiceLine il\
ON il.InvoiceId = i.InvoiceId\
JOIN Track t\
ON t.TrackId = il.TrackId\
JOIN Genre g\
ON g.GenreId = t.GenreId\
WHERE c.Country = "Germany" AND c.city ="Berlin"\
GROUP BY Genres, c.City\
ORDER BY c.state, Total_spent DESC
  1. /*Query 4- query used to obtain the no of alternative tracks in playlist/
SELECT p.PlaylistId, g.Name, p.Name Playlists, Count(t.Name) AS Tracks\
FROM Playlist p\
JOIN PlaylistTrack pt\
ON pt.PlaylistId = p.PlaylistId\
JOIN Track t\
ON pt.TrackId = t.TrackId\
JOIN Genre g\
ON t.GenreId = g.GenreId\
WHERE g.name = "Alternative"\
GROUP BY Playlists\
ORDER BY Tracks

music_store-sql-data-exploration_projectn-'s People

Contributors

adeleke1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.