Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗄️ Foodie-Fi — Subscription Analytics in SQL

Answering the customer-lifecycle questions of a subscription streaming startup using MySQL — Danny Ma's #8WeekSQLChallenge, Case Study #3.

Foodie-Fi streams only food-related content — "Netflix, but exclusively cooking shows." Using nothing but their subscription data, this project answers the questions a real growth/analytics team asks: How many customers do we have? How many churn, and when? What does a typical upgrade/downgrade journey look like — and what is it worth?


🎯 What this demonstrates

  • Turning business questions into SQL — churn %, trial-to-paid conversion, plan migration, revenue
  • Window functions, self-joins, CTEs, and date logic to reconstruct each customer's journey
  • Reasoning over a relational schema (ERD below)

🗂️ Data model

Table Description
plans Plan catalog — trial, basic monthly, pro monthly, pro annual, churn, with prices
subscriptions Every plan-change event per customer, with start_date

ERD

❓ Questions answered (excerpt)

Full solutions in Foodie_Sql_querries.sql:

  1. How many customers has Foodie-Fi ever had?
  2. Monthly distribution of trial-plan starts
  3. Plan-event breakdown for start dates after 2020
  4. Customer count & % who have churned (rounded to 1 dp)
  5. % who churned immediately after the free trial
  6. Customer journeys, upgrades/downgrades, and revenue analysis

💡 Example insight: the queries compute the exact churn rate and the share of customers who leave straight after the trial — the two metrics a subscription business steers on first.

▶️ How to run

SOURCE "Foodie-Fi Schema.sql";      -- create + populate the database
SOURCE "Foodie_Sql_querries.sql";   -- run the analysis queries

Tested on MySQL 8+ (Workbench, DBeaver, or any MySQL client).

📁 Contents

File Purpose
Foodie-Fi Schema.sql Table definitions + seed data
Foodie_Sql_querries.sql All analysis queries, commented per question
ERD.jpg Entity-relationship diagram

Case study by Danny Ma — #8WeekSQLChallenge. Solutions authored by Sadiq Mansoor.

About

Subscription based businesses are super popular and there is significant gap in the market- to create a new streaming service that only had food-related content - something like Netflix but with only cooking shows.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors