Write a SQL query to calculate month-over-month growth rate for DNA kit sales.
Use completed DNA kit sales and include every calendar month in the reporting period, including months with zero sales. Treat growth as undefined when there is no prior month or the prior month has zero sales.
month, total_kits_sold, previous_month_kits, and mom_growth_rate_pct| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sale identifier |
| sold_at | DATE | Date on which the sale was recorded |
| product_category | VARCHAR(50) | Category of the purchased product |
| quantity | INT | Number of kits in the sale |
| sale_status | VARCHAR(20) | Processing status of the sale |
| channel | VARCHAR(30) | Marketing or sales channel |
| Column | Type | Description |
|---|---|---|
| month_startPK | DATE | First day of a reporting month |