dimikara / SQL-Query-a-DB

Business Analytics - Query a Digital Music Store Database (SQLite)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Query a Digital Music Store Database (SQLite)

Introduction

In this project, I am querying the Chinook Database which holds information about a music store. The goal is to assist the Chinook team with understanding the media in their store, their customers and employees, and their invoice information.

The Chinook Database

As a reference for the database & queries, the schema for the Chinook Database is provided below. There we can see the columns that link tables together via the arrows. This diagram is known as an entity-relationship diagram (ERD), and shows us how data is structured in the database and helps us visualize the data we are analyzing.

Chinook Database Schema

The Chinook Database contains the following tables:

Table Content
Album List of tracks and Artist ID
Artist Artist ID and name
Customer Customer data
Employee Employee data
Genre Music genre, for example, rock, blues, latin, etc.
Invoice Invoice data
Invoiceline Invoice item data per line
MediaType For example, MPEG or Protected AAC audio file
Playlist Playlist ID & name
PlaylistTrack Playlist & Track IDs
Track Song data

Used Skills

The main goal of this project is to use SQL for querying the Chinook database. For the execution of SQL queries I am using DB Browser for SQLite.

Project

The project consists of the following:

  • Writing 4 SQL queries in order to reply to 4 business questions

  • Extracting the data to Excel and create an appropriate visualization for each of the questions

  • Creating a Presentation file to share the findings. This file contains 5 slides for the business questions I am querying the database about.

Business questions

    1. How is Revenue split per Media Type?
    1. Which is the Music Genre that dominates in most countries?
    1. Which are the top 10 Artists that earned the most on 2013?
    1. How did the Revenue for “Rock” genre change during the period 2009-2013?

How to run the queries

To run the queries yourself, follow the instructions below:

  1. Download the Chinook database from the GitHub site

  2. Download the appropriate version of DB Browser for SQLite, depending on your computer setup

  3. Connect the Browser to the Database, following the below steps:

    • Open up DB Browser for SQLite
    • Click on Open Database
    • Navigate to the Chinook.db file in the folder where you saved it
    • Click on the Execute SQL
    • Copy and paste the queries from the txt file or write your own queries to query the data

SQLite browser

Notes:

  • Although here I am using the DB Browser for SQLite, there are many different SQL database browsers that can work with different types of databases.
  • All graphs were created in Google Sheets.

References


About

Business Analytics - Query a Digital Music Store Database (SQLite)