Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ndleah/dvd-rental-marketing-analytics
π₯ Email marketing campaign analysis
https://github.com/ndleah/dvd-rental-marketing-analytics
data-analysis data-exploration data-modelling data-structures data-wrangling database sql
Last synced: 9 days ago
JSON representation
π₯ Email marketing campaign analysis
- Host: GitHub
- URL: https://github.com/ndleah/dvd-rental-marketing-analytics
- Owner: ndleah
- Created: 2021-06-01T04:20:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-14T17:35:46.000Z (over 3 years ago)
- Last Synced: 2024-11-13T08:39:21.584Z (2 months ago)
- Topics: data-analysis, data-exploration, data-modelling, data-structures, data-wrangling, database, sql
- Language: SQL
- Homepage: https://www.datawithdanny.com
- Size: 28.9 MB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![Star Badge](https://img.shields.io/static/v1?label=%F0%9F%8C%9F&message=If%20Useful&style=style=flat&color=BC4E99)
![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)
[![View My Profile](https://img.shields.io/badge/View-My_Profile-green?logo=GitHub)](https://github.com/ndleah)
[![View Repositories](https://img.shields.io/badge/View-My_Repositories-blue?logo=GitHub)](https://github.com/ndleah?tab=repositories)# DVD Rental Marketing Analytics
> This case study is contained within the [Serious SQL](https://www.datawithdanny.com) by [Danny Ma](https://www.linkedin.com/in/datawithdanny/). 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](#οΈ-requirements)
* π [Data Overview](#-data-overview)
* π [Solution](#-solutions)
* π§ββοΈ [Result](#οΈ-result)
* π [Bonus Section](#-bonus-section)# π οΈ 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](https://img.shields.io/badge/View-Data_Exploration_Folder-b11226?style=for-the-badge&logo=GITHUB)](/Data%20Exploration)
## 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](https://img.shields.io/badge/View-Data_Join_Folder-b11226?style=for-the-badge&logo=GITHUB)](/Data%20Join)
# π 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](#Key-Business-Requirements) section of this case study.
## View the entire solution for this part [**here**][![View Problem Solving Folder](https://img.shields.io/badge/View-Problem_Solving_Folder-b11226?style=for-the-badge&logo=GITHUB)](/Problem%20Solving)
# π§ββοΈ 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](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request)**.
# π Support
Give a βοΈ if you like this project!
___________________________________Β© 2021 Leah Nguyen