Write a query to find the month-over-month growth rate of active patients booking appointments on Zocdoc.
Use the patients and appointments tables. Treat an active patient as one whose is_active value is true and who has at least one appointment with a booked status in the month.
month, active_patient_count, previous_active_patient_count, and mom_growth_ratemom_growth_rate as a percentage rounded to two decimal places; return NULL when there is no prior month or the prior count is zero| Column | Type | Description |
|---|---|---|
| patient_idPK | INT | Unique patient identifier |
| patient_name | VARCHAR(100) | Patient display name |
| is_active | BOOLEAN | Whether the patient is currently active |
| Column | Type | Description |
|---|---|---|
| appointment_idPK | INT | Unique appointment identifier |
| patient_id | INT | Patient associated with the appointment |
| booked_at | TIMESTAMP | Timestamp when the appointment was booked |
| status | VARCHAR(20) | Appointment booking status |