Given two tables (users and transactions), write a query to find the average spend per user cohort for Pocket Fm.
Define a cohort by the month of users.signup_date. Include every registered user in the calculation, including users with no transactions, whose spend should be treated as zero. Ignore transactions that do not belong to a registered user.
cohort_month, average_spend_per_user, and user_count.cohort_month ascending.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Pocket Fm user identifier |
| signup_date | DATE | Date on which the user registered |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| user_id | INT | User associated with the transaction |
| amount | NUMERIC(10,2) | Recorded transaction amount |
| transaction_date | DATE | Date on which the transaction occurred |