Zomato Data Analysis Using SQL









Tool used:
MySQL

Data Base : MySQL

Projects challenge : Design a program that analyzes customer data on Zomato to calculate the average spending per customer, determine the number of days each customer has visited, identify their very first purchase, and find the most purchased item on the menu along with its total sales across all customers

Projects Summary :

Used SQL to dig deep into Zomato data, finding useful information. Found out how much customers typically spend, how often they visit, and what they like to order. Figured out what customers bought first, showing what they like and how they found Zomato. Suggested better menu options and prices to make more money. Found loyal customers to target for ads, keeping them happy and coming back.

Here are some problem statements and SQL query :

 # How Much user are spending on zomato ?


select a.userid,sum(b.price) as Total_Price

from sales a

inner join product b 

on a.product_id =b.product_id

group by a.userid;



#how many days user is visits Zomato or purchased from Zomato ?


select userid,count(created_date) as distinct_days from sales group by userid;




#what was the first products purchased by each customer ?


select*from

(select*,rank() over( partition by userid order by created_date) as rnk from sales)a where rnk=1;



#what is most purchased item on the menu and how many time was it purchased by all customers?


select userid,count(product_id) as count_products from sales where product_id=

(select product_id from  sales

group by product_id order by count(product_id) desc limit 1)

group by userid ;




#which is the popular products for each customer ?


select * from(

select*,rank() over(partition by userid order by popular desc) Ranks from

(select userid,product_id,count(product_id) as popular from sales 

group by userid, product_id)as a) as b

where Ranks =1;




Thanks you for your time  if you've any suggestion drop a mail by click here

Tags