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

Поделиться
HTML-код
  • Опубликовано: 5 ноя 2023
  • 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

Комментарии • 2

  • @Naveen-uz4hw

    select distinct cust_id

  • @nidhisingh4973

    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.