TGViewer
SQL Programming Resources SQL Programming Resources @sqlanalyst ยท 76.7K subscribers
Post #2641 2.57K
๐Ÿš€ SQL Project Series #26

SaaS Product Analytics ๐Ÿ’ป

Analyze users, subscriptions, feature usage, payments, and customer behavior using SQL to improve product adoption, retention, and revenue.

๐ŸŽฏ Business Objectives
โœ… Analyze user growth
โœ… Track subscription plans
โœ… Monitor feature adoption
โœ… Measure Monthly Recurring Revenue (MRR)
โœ… Analyze customer retention
โœ… Identify customer churn
โœ… Measure product engagement
โœ… Build executive SaaS dashboards

๐Ÿ“‚ Step 1: Create Database
CREATE DATABASE saas_analytics_db;
USE saas_analytics_db;

๐Ÿ“‚ Step 2: Create Users Table
CREATE TABLE users (
user_id INT PRIMARY KEY,
user_name VARCHAR(100),
company_name VARCHAR(100),
country VARCHAR(50),
signup_date DATE
);

๐Ÿ“‚ Step 3: Create Subscription Plans Table
CREATE TABLE subscription_plans (
plan_id INT PRIMARY KEY,
plan_name VARCHAR(50),
monthly_price DECIMAL(10,2)
);

๐Ÿ“‚ Step 4: Create Subscriptions Table
CREATE TABLE subscriptions (
subscription_id INT PRIMARY KEY,
user_id INT,
plan_id INT,
start_date DATE,
end_date DATE,
subscription_status VARCHAR(20),
FOREIGN KEY (user_id) REFERENCES users(user_id),
FOREIGN KEY (plan_id) REFERENCES subscription_plans(plan_id)
);

๐Ÿ“‚ Step 5: Create Feature Usage Table
CREATE TABLE feature_usage (
usage_id INT PRIMARY KEY,
user_id INT,
feature_name VARCHAR(100),
usage_date DATE,
usage_count INT,
FOREIGN KEY (user_id) REFERENCES users(user_id)
);

๐Ÿ“‚ Step 6: Create Payments Table
CREATE TABLE payments (
payment_id INT PRIMARY KEY,
subscription_id INT,
payment_date DATE,
amount DECIMAL(10,2),
payment_status VARCHAR(20),
FOREIGN KEY (subscription_id) REFERENCES subscriptions(subscription_id)
);

๐Ÿ“‚ Step 7-11: Sample Data
Users, Subscription Plans, Subscriptions, Feature Usage, and Payments tables are populated with sample data for Rahul, Priya, John, Emma, and Amit across Free, Basic, Pro, and Enterprise plans.

๐Ÿง  SQL Concepts You'll Practice
โœ” DDL & DML
โœ” INNER JOIN / LEFT JOIN
โœ” Aggregate Functions
โœ” GROUP BY / HAVING
โœ” CASE WHEN
โœ” Date Functions
โœ” CTEs
โœ” Window Functions
โœ” Ranking Functions

๐Ÿ“Š Business KPIs You Can Build
๐Ÿ“ˆ Growth: Total Users, Active Users, Paid Users, Free vs Paid Users, Subscription Growth
๐Ÿ“ˆ Revenue: MRR, ARR, ARPU, CLV, Revenue by Subscription Plan, Payment Success Rate
๐Ÿ“ˆ Retention: Customer Churn Rate, Customer Retention Rate, DAU, MAU, DAU/MAU Ratio
๐Ÿ“ˆ Product: Feature Adoption Rate, Most Used Features, Feature Usage by Plan
๐Ÿ“ˆ Customers: Top Enterprise Customers, Executive SaaS Dashboard

This project reflects real-world SQL analysis performed by Product Analysts, Growth Analysts, Customer Success teams, Revenue Operations teams, and BI professionals at SaaS companies like Salesforce, HubSpot, Atlassian, Notion, Slack, and Zoom.

Double Tap โค๏ธ For More
  • โค 6
  • ๐Ÿ‘ 1
  • ๐Ÿ‘ 1
More from @sqlanalyst
  1. Oct 8, 2026๐ŸŽ“ ๐— ๐—ถ๐—ฐ๐—ฟ๐—ผ๐˜€๐—ผ๐—ณ๐˜ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐˜„๐—ถ๐˜๐—ต ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ฒ๐˜€! ๐Ÿš€๐Ÿ”ฅ Upgrโ€ฆ
  2. Oct 7, 2026๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐโ€ฆ
  3. Oct 7, 2026SQL Interview Series โ€” Part 4 ๐Ÿ“Œ Question 4: Find the Highest Salary in Each Department Suโ€ฆ
  4. Oct 7, 2026๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ ๐—•๐—œ ๐—ณ๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜! ๐Ÿ”ฅ Learn Power BI through these FREE learninโ€ฆ
  5. Sep 29, 2026SQL Interview Series โ€” Part 2 ๐Ÿ“Œ Question 2: Find Duplicate Records Suppose you have an Emโ€ฆ
  6. Sep 29, 2026๐—™๐—ฅ๐—˜๐—˜ ๐—ฅ๐—ฒ๐˜€๐—ผ๐˜‚๐—ฟ๐—ฐ๐—ฒ๐˜€ ๐—ง๐—ผ ๐—Ÿ๐—ฒ๐—ฎ๐—ฟ๐—ป ๐—”๐—œ ๐—ถ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ๐Ÿš€ โ€‹ Explore 6 free resourceโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’