Skip to content

ndleah/dvd-rental-marketing-analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

75 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Star Badge Open Source Love View My Profile View Repositories

DVD Rental Marketing Analytics

This case study is contained within the Serious SQL by Danny Ma. With this Marketing Analytics Case Study, I was asked to support the customer analytics team at DVD Rental Co who have been tasked with generating the necessary data points required to populate specific parts of this first-ever customer email campaign.

πŸ“• Table of contents

πŸ› οΈ Requirements

The marketing team have shared with me a draft of the email they wish to send to their customers:

πŸ“‹ Requirement 1: Top 2 Categories

Click to view

For each customer, I need to identify the top 2 categories each customer based off their past rental history.

πŸ“‹ Requirement 2: Category Film Recommendations

Click to view

The marketing team has also requested for the 3 most popular films for each customer’s top 2 categories.

πŸ“‹ Requirement 3 & 4: Individual Customer Insights

Click to view

The number of films watched by each customer in their top 2 categories is required as well as some specific insights.

For the 1st category, the marketing requires the following insights (requirement 3):

  1. How many total films have they watched in their top category?
  2. How many more films has the customer watched compared to the average DVD Rental Co customer?
  3. How does the customer rank in terms of the top X% compared to all other customers in this film category?

For the second ranking category (requirement 4):

  1. How many total films has the customer watched in this category?
  2. What proportion of each customer’s total films watched does this count make?

πŸ“‹ Requirement 5: Favorite Actor Recommendations

Click to view

Along with the top 2 categories, marketing has also requested top actor film recommendations where up to 3 more films are included in the recommendations list as well as the count of films by the top actor.

πŸ“‚ Data Overview

Data Exploration

In this project, I have a total of 7 tables in our ERD (Entity Relationship Diagram), highlighting the important columns which I should use to join my tables for the data analysis task.

Therefore, the first section will cover the data inspection process of these tables in order to find out the best JOIN type that will be the most suitable for the later problem solving stage.

View Data Exploration Folder

Data Join

Now that I’ve identified the key columns and highlighted some things I need to keep in mind when performing some table joins for my data analysis - next exciting step is to join them together.

View Data Join Folder

πŸš€ Solutions

Finally, after I’ve combined all of different datasets together into a single base table which I can use for our insights, this section will aim to cover those core calculated fields which I broke down in the first Key Business Requirements section of this case study.

View the entire solution for this part [here]

View Problem Solving Folder

πŸ§™β€β™‚οΈ Result

Assume this email template will be sent to a customer with customer_id = 1, I will first go back to the requirements of the marketing team and by that, answer each question one by one regarding this customer's scenario.

Requirement 1: Top 2 Categories
customer_id category_name rental_count category_rank
1 Classics 6 1
1 Comedy 5 2
Requirement 2: Category Film Recommendations
customer_id category_name category_rank film_id title rental_count reco_rank
1 Classics 1 891 TIMBERLAND SKY 31 1
1 Classics 1 358 TIMBERLAND SKY 28 2
1 Classics 1 951 VOYAGE LEGALLY 28 3
1 Comedy 2 1000 ZORRO ARK 31 1
1 Comedy 2 127 CAT CONEHEADS 30 2
1 Comedy 2 638 OPERATION OPERATION 27 3
Requirement 3 & 4: Individual Customer Insights

FIRST CATEGORY INSIGHTS

customer_id category_name rental_count average_comparison percentile
1 Classics 6 4 1

SECOND CATEGORY INSIGHTS

customer_id category_name rental_count category_percentage
1 Comedy 5 16
Requirement 5: Favorite Actor Recommendations

Result:

customer_id first_name last_name rental_count title film_id actor_id reco_rank
1 VAL BOLGER 6 PRIMARY GLASS 697 37 1
1 VAL BOLGER 6 ALASKA PHANTOM 12 37 2
1 VAL BOLGER 6 METROPOLIS COMA 572 37 3

Final Output

Hooray! Finally, this is what out final input looks like:

✨ Contribution

Contributions, issues, and feature requests are welcome!

To contribute to this project, see the GitHub documentation on creating a pull request.

πŸ‘ Support

Give a ⭐️ if you like this project!


Β© 2021 Leah Nguyen