filmov
tv
SQL Interview Question on Customer Retention in Subscription Model | English | Swiggy | sqlonline.in

Показать описание
SQL Query for retention
In this SQL interview question, we'll look at how to find the month-on-month customer retention rate in a subscription-based business model, using the example of Swiggy. You'll learn how to analyze customer behaviour and identify trends, essential skills for data analysts and business intelligence professionals.
Table Creation
CREATE TABLE transactions (
customer_id INT,
transaction_date DATE);
INSERT INTO transactions (customer_id, transaction_date)
VALUES
(1, '2022-01-01' ),
(1, '2022-01-05' ),
(1, '2022-01-08' ),
(1, '2022-01-15' ),
(2, '2022-01-02' ),
(2, '2022-01-09' ),
(2, '2022-01-16' ),
(2, '2022-01-23' ),
(3, '2022-01-03' ),
(3, '2022-01-10' ),
(3, '2022-01-17' ),
(3, '2022-01-24' ),
(4, '2022-01-04' ),
(4, '2022-01-11' ),
(4, '2022-01-18' ),
(4, '2022-01-25' ),
(5, '2022-01-07' ),
(5, '2022-01-14' ),
(5, '2022-01-21' ),
(5, '2022-01-28' ),
(1, '2022-02-01' ),
(1, '2022-02-05' ),
(1, '2022-02-08' ),
(1, '2022-02-15' ),
(2, '2022-02-02' );
select * from transactions;
#interview #analytics #businessanalysis #product #sql #bigquery #mysql #mocktest #union #string #split #substring #pivot #iterate #credit #debit #transaction #selfjoin #innerjoin #chatgpt #cred #subquery #monthly #retentions #sql # retention
#SQLInterviewQuestion, #CustomerRetention, #SubscriptionBusiness #Model, #Swiggy, #dataanalysis , #businessanalystinterview #Intelligence, #DataAnalytics, #MySQL, #SQL Queries
Комментарии