Тёмный

Customer Retention and Churn Analysis | Part 2 | SQL Intermediate Question 6 

Code-Con
Подписаться 1,1 тыс.
Просмотров 489
50% 1

Customer retention refers to the ability of a company or product to retain its customers over some specified period. High customer retention means customers of the product or business tend to return to, continue to buy or in some other way not defect to another product or business, or to non-use entirely.
Company programs to retain customers: Zomato Pro , Cashbacks, Reward Programs etc.
Once these programs in place we need to build metrics to check if programs are working or not. That is where we will write SQL to drive customer retention count.
Question :- FIND THE CHURN RATE
DDL Script :-
drop table transactions
create table transactions(
order_id int,
cust_id int,
order_date date,
amount int
);
delete from transactions;
insert into transactions values
(1,1,'2020-01-15',150)
,(2,1,'2020-02-10',150)
,(3,2,'2020-01-16',150)
,(4,2,'2020-02-25',150)
,(5,3,'2020-01-10',150)
,(6,3,'2020-02-20',150)
,(7,4,'2020-01-20',150)
,(8,5,'2020-02-20',150);
For more Questions follow this playlist :-
• SQL Intermediate Quest...
#sql #sqldeveloper #sqlserver #dataanalytics #interviewquestions

Опубликовано:

 

5 ноя 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 2   
@Naveen-uz4hw
@Naveen-uz4hw 21 день назад
select distinct cust_id from (select * ,min(order_date) over(partition by cust_id order by order_date) as min_date ,max(order_date) over(partition by cust_id order by order_date desc) as max_date from transactions)a where (month(max_date)-month(min_date))=1
@nidhisingh4973
@nidhisingh4973 2 месяца назад
Thank you. Do you think this will work for not consecutive month order date and different year order date. Suppose cust_id 1 has ordered in Jan, Feb and May. So ideally this id should come for Feb churn analysis but this will not come with this solution approach. Please correct me if I am wrong.
Далее
I Built 100 Houses And Gave Them Away!
09:36
Просмотров 54 млн
Calculating Churn Rates with SQL
1:51:05
Просмотров 4,2 тыс.
SQL | Active User Retention
9:52
Просмотров 110
#Tableau - Calculate Customer Churn Rate
6:58
Просмотров 14 тыс.