Overview
R Mart is a retail giant with over 50 supermarkets in the southern region of India. All their 50 stores ran a massive promotion on their branded products, during Diwali Festival - 2023 and Sankranti Festival - 2024 (Big festivals in India).
The sales director wants to understand which promotions did well and which did not, so that they can make decisions and get information for their next promotional period. Also, the overview of stores, highest number of stores across cities and the top performers. With respect to products and their performance in terms of different Promo types, in comparison with percentage of Incremental revenue and sold quantity.
SQL Code:
select * from dim_campaigns;
select * from dim_products;
select * from dim_stores;
select * from fact_events;
-- Base price greater than 500 and "BOGOF"
select product_code,promo_type,base_price
from fact_events
where base_price >=500 and promo_type="BOGOF"
group by product_code
order by product_code;
-- Store distribution by city
select s.city,count(f.store_id) as store_count from fact_events f
right join dim_stores s
on f.store_id=s.store_id
group by s.city;
-- total revenue by diffrent campaigns
select * from fact_events;
select campaign_id,
sum(revenue_beforepromo)/1000000 beforepromo_in_millions,
sum(revenue_after_promo)/1000000 as afterprom_in_millions
from fact_events
group by campaign_id
order by 2,3 desc ;
-- ISU% for each category
select * from fact_events;
with ISU_cte as (
select pr.category,sum(f.ISU)/sum(f.quantity_sold_beforepromo)*10 as percent
from fact_events f
join dim_products pr
on f.product_code=pr.product_code
where f.campaign_id='CAMP_DIW_01'
group by pr.category
)
select category,round(percent,2),RANK() OVER (ORDER BY percent DESC) AS categoryrank
from ISU_cte
order by categoryrank ;
-- top 5 products on incremental revenue
with IR_cte as (
select pr.product_name,pr.category,sum(f.IR)/sum(f.revenue_beforepromo)*10 as percent
from fact_events f
join dim_products pr
on f.product_code=pr.product_code
group by pr.product_name,pr.category
)
select * from(
select product_name,category
,percent,RANK() OVER (ORDER BY percent DESC) AS categoryrank
from IR_cte
group by product_name,category
order by categoryrank
)as ranked_data
where categoryrank<=5
• Store ID STMYS-1 has achieved the highest sales and incremental revenue percentage (IR%), indicating a strong performance. Additionally, STMYS-2 has shown a significant increase in incremental revenue. Furthermore, store STBLR-1 has emerged as the top performer in terms of quantity sold.
• It's important to note that the IR% represents the incremental revenue to the change in quantities sold, while the ISU% indicates the difference in quantities sold before and after promotions, such as BOGOF, 33% off, and 25% off.
• These insights will provide a comprehensive understanding of the stores' performance, enabling informed decision-making and strategic planning for the future.
• The Combo1 category has experienced a significant increase in total revenue during the campaign season.
• In contrast, the home appliances category has shown a remarkable 265% increase in incremental revenue percentage (IR%) compared to its sales before the promotion.
• This data provides valuable insights into the performance of these categories during the promotional period, enabling informed decision-making and strategic planning for the future.
• The revenue generated during the Diwali season significantly surpasses that of the Sankranti season. Additionally, the "prom type 500 cashback" outperformed the "BOGOF" promotion, ranking second in sales in terms of IR%.
• The "25% off" followed by "50% off" promotion types are the lowest performers in terms of ISU%. On the other hand, "BOGOF" ranks highest in both IR% and ISU% among the different promotion types.
• The Diwali season is known for its substantial impact on sales and revenue, making it a crucial period for businesses to implement effective marketing strategies and promotions.