Write a SQL query to find the month-over-month growth in solar lead conversions for the California market.
Use the conversion date to determine each month. Include months with zero conversions between the first and last California conversion month, and return NULL growth when the prior month has zero conversions or does not exist.
conversion_month, conversions, prior_month_conversions, and mom_growth_pct.| Column | Type | Description |
|---|---|---|
| lead_idPK | INT | Unique identifier for the solar lead |
| market_id | INT | Market associated with the lead |
| lead_created_at | TIMESTAMP | Timestamp when the lead was created |
| converted_at | TIMESTAMP | Timestamp when the lead converted |
| Column | Type | Description |
|---|---|---|
| market_idPK | INT | Unique identifier for the market |
| market_name | VARCHAR(100) | Market name used for reporting |
| state_code | VARCHAR(2) | Two-letter state code when applicable |