Your question is SQL for Retention or Conversion. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Salesforce Operations wants to monitor month-over-month adoption of Salesforce Data Cloud across customer segments. Write a PostgreSQL query that calculates monthly user retention by segment for February and March 2025.
NULL when the prior-month count is zero.Uncategorized.| Column | Type | Description |
|---|---|---|
| user_idPK | INTEGER | Unique user identifier |
| signup_date | DATE | Date the user signed up |
| segment | VARCHAR(30) | Customer segment |
| Column | Type | Description |
|---|---|---|
| activity_idPK | INTEGER | Unique activity record |
| user_id | INTEGER | User associated with the activity |
| activity_month | DATE | Month of activity, stored as a month-start date |