Sales Analytics Project EP 04 | Product, Profit & Pricing Analysis | Real-World Data Analyst Project
SQL Sales Analytics EP 04 | Product, Profit & Pricing Analysis | Real-World SQL Project
Season 01: Sales Analytics | Episode 04
What products actually drive revenue? Which products are truly profitable after accounting for cost? And what happens when prices change?
In Episode 04, we dive into Products & Categories Analysis using SQL to solve real-world business problems around product performance, profitability, pricing, Pareto analysis, manufacturers, and vehicle compatibility.
🔥 In this episode, we solve:
1️⃣ Revenue & Gross Margin by Category
Analyze revenue and gross margin across categories and sub-categories using the part category hierarchy.
2️⃣ Top 100 Parts by Revenue
Rank parts by revenue and calculate their cumulative contribution to total revenue using a running percentage.
3️⃣ 80/20 Pareto Analysis
Identify how many parts collectively generate 80% of total revenue.
4️⃣ OEM vs Non-OEM Analysis
Compare OEM and non-OEM manufacturers based on:
• Distinct parts sold
• Revenue
• Gross margin
• Margin percentage
5️⃣ Price Change & Sales Volume Analysis
Analyze whether list price changes are associated with changes in unit volume by comparing sales volume 30 days before and after each price change.
6️⃣ Top Vehicle Makes & Models
Identify the top 25 vehicle makes and models generating revenue from compatible parts.
💡 Advanced SQL Concepts Used
✓ Recursive CTE for dynamic category hierarchy
✓ Running cumulative percentage with Window Functions
✓ Pareto / 80-20 Analysis
✓ Revenue & Gross Margin Analysis
✓ Time-based price change analysis
✓ Before & after period comparison
✓ OEM vs Non-OEM segmentation
✓ Vehicle compatibility analysis
✓ Ranking and Top-N analysis
⚡ Important Business Logic
This isn't just about calculating revenue.
We also account for the part's cost_price at the time of sale to calculate a more meaningful gross margin.
That means we're analyzing what the business actually earned — not simply looking at today's product price.
🎯 What You'll Learn
By the end of this episode, you'll understand how SQL can be used to answer practical product and profitability questions that Data Analysts face in real businesses.
This is not a SQL syntax-only tutorial.
The approach is:
Business Problem → Analytical Question → SQL Query → Result → Business Insight
📊 SQL Data Analyst – Real World – End to End Project
Season 01: Sales Analytics
We're building this project episode by episode, solving real business problems using SQL and turning raw business questions into analytical results.
Perfect for:
• Aspiring Data Analysts
• SQL Analysts
• Freshers learning SQL
• Data Analyst Job Seekers
• Career Switchers
• Working Professionals
• SQL Interview Preparation
If you're learning SQL for a Data Analyst career, don't just practice isolated queries.
Learn how SQL is actually used to solve business problems.
Subscribe to Variablz Academy and follow the complete project.
#SQL #DataAnalyst #SQLProject #SalesAnalytics #DataAnalytics #SQLForDataAnalysis #DataAnalystProject #BusinessAnalytics #ProductAnalytics #ProfitabilityAnalysis #ParetoAnalysis #PostgreSQL #SQLInterview #DataAnalystInterview #RealWorldSQL #theparthee #variablzacademy