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 |