An independent project performed to apply SQL knowledge to a data science problem.
After completing the codecademy course for SQL and reading through w3schools documentation on SQL, I decided to apply what I'd learned via a small project.
The project provides access to a small sample data set and are asked to answer some questions ranging in difficulty from easy to difficult.
The data set is located here and consists of the following tables:
employeestable stores employees data such as employee id, last name, first name, etc. It also has a field named ReportsTo to specify who reports to whom.customerstable stores customers data.invoices&invoice_itemstables: these two tables store invoice data. The invoices table stores invoice header data and the invoice_items table stores the invoice line items data.artiststable stores artists data. It is a simple table that contains only artist id and name.albumstable stores data about a list of tracks. Each album belongs to one artist. However, one artist may have multiple albums.media_typestable stores media types such as MPEG audio and AAC audio file.genrestable stores music types such as rock, jazz, metal, etc.trackstable store the data of songs. Each track belongs to one album.playlists&playlist_tracktables: playlists table store data about playlists. Each playlist contains a list of tracks. Each track may belong to multiple playlists. The relationship between the playlists table and tracks table is many-to-many. The playlist_track table is used to reflect this relationship.
Added all of my responses to the following prompts under the basic folder in this repository.
-
Which tracks appeared in the most playlists? how many playlist did they appear in?
-
Which track generated the most revenue? which album? which genre?
-
Which countries have the highest sales revenue? What percent of total revenue does each country make up?
-
How many customers did each employee support, what is the average revenue for each sale, and what is their total sale?
- Do longer or shorter length albums tend to generate more revenue?
- How much revenue is generated each year, and what is its percent change 1 from the previous year?
Mini project completed in four hours on Mac OS, using DB Browser for SQLite.