0% found this document useful (0 votes)
4 views

KPI Cal Queries

Kpi calculation

Uploaded by

apurvaj1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

KPI Cal Queries

Kpi calculation

Uploaded by

apurvaj1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Submitted to

MIT-WPU School of Business, Pune.


SY MBA BA-B
Under the guidance of
Prof. Suhas Joshi

Group Number: Group 4

Sr. No Name PRN

1. Apurva Jagtap 1062232467

2. Sahil Pandey 1062232740

3. Abhishek Ghongade 1062232175

4. Payal Sen 1062232513

5. Saurabh Sahare 1062233029

6. Paras singh Rajput 1062231516

1
1. KPI Calculation Queries:

Sales Performance:

-- Total Revenue and Average Profit Margin from Sales

SELECT

SUM(Revenue) AS total_revenue,

AVG(ProfitMargin) AS avg_profit_margin

FROM

sales;

2
Customer Insights
-- Calculate Customer Retention Rate for a specific period (e.g., last year)

SELECT

COUNT(DISTINCT CASE WHEN JoinDate >= '2019-11-19' AND JoinDate < '2024-11-17'
THEN CustomerID END) AS retained_customers,

COUNT(DISTINCT CustomerID) AS total_customers,

(COUNT(DISTINCT CASE WHEN JoinDate >= '2019-11-19' AND JoinDate < '2024-11-17'
THEN CustomerID END) * 100.0 /

COUNT(DISTINCT CustomerID)) AS retention_rate

FROM

customers;

-- Average Customer Age

SELECT

AVG(Age) AS avg_customer_age

FROM

customers

3
Operational Metrics

--- Average Fulfillment Time in Days

SELECT

AVG(DATEDIFF(DeliveryDate, OrderDate)) AS avg fulfillment_time_days

FROM

orders

WHERE

OrderStatus 'Delivered';

--- Order Accuracy Percentage

SELECT
Marketing Performance
(SUM(CASE WHEN OrderStatus = 'Delivered' THEN 1 ELSE 0 END) * 100.0 / COUNT(*)) AS
order_accuracy_percentage

FROM

orders;

4
Marketing Performance
-- Total Customer Acquisition Cost (if each campaign targets unique customers)

SELECT

SUM(AdSpend) / NULLIF(COUNT(DISTINCT CampaignID), 0) AS customer_acquisition_cost

FROM

campaigns;

-- ROAS (Return on Advertising Spend)

SELECT

SUM(Revenue) / NULLIF(SUM(AdSpend), 0) AS roas

FROM

sales;

5
Product Insights

-- Return Rate (using Order Status for returned items)

SELECT

ProductID,

(SUM(CASE WHEN OrderStatus = 'Returned' THEN 1 ELSE 0 END) * 100.0 / COUNT(*)) AS


return_rate_percentage

FROM

orders

GROUP BY

ProductID;

6
Financial Metrics

-- Gross Profit Margin

SELECT

SUM(Revenue - COGS) * 1.0 / NULLIF(SUM(Revenue), 0) * 100 AS gross_profit_margin

FROM

sales;

-- Total Ad Spend

SELECT

SUM(AdSpend) AS total_ad_spend

FROM

campaigns;

You might also like