A retention squad triages accounts by how long they have been inactive and whether auto-renew is switched on.
From subscriptions, return account_code, days_inactive, auto_renew and a risk_band computed as:
Criticalwhendays_inactiveis 60 or more andauto_renewis falseHighwhendays_inactiveis 60 or more (auto-renew on)Watchwhendays_inactiveis between 30 and 59Healthyotherwise
Sample data
More CASE Statements questions
Practising alone only goes so far — our live cohorts pair SQL depth with dashboards, agentic analytics projects and mock interviews.
Explore the program