Write a SQL query to join a user activity table with a billing table to calculate the average monthly spend per active Google Cloud customer.
Treat a customer as active in a month when the activity table contains activity for that customer during that month. Customers with no billing record in an active month should contribute zero spend.
month, active_customer_count, and average_monthly_spend.| Column | Type | Description |
|---|---|---|
| activity_idPK | INT | Unique activity event identifier |
| customer_id | INT | Google Cloud customer identifier |
| activity_date | DATE | Date of customer activity |
| activity_type | VARCHAR(50) | Type of activity recorded |
| Column | Type | Description |
|---|---|---|
| billing_idPK | INT | Unique billing record identifier |
| customer_id | INT | Google Cloud customer identifier |
| billing_date | DATE | Date the charge was recorded |
| amount | NUMERIC(12,2) | Charge amount in USD |