Write a SQL query to calculate weekly application volume, approval rate, and average time to certification using date functions and aggregations.
Use the application submission date to define each week. Include weeks with applications, and calculate certification time only for applications with a matching certification record.
week_start, application_volume, approval_rate, and average_days_to_certification.approval_rate is the percentage of applications whose status is approved, rounded to two decimal places. Average certification time is measured in days and rounded to two decimal places.| Column | Type | Description |
|---|---|---|
| application_idPK | INT | Unique application identifier |
| submitted_at | TIMESTAMP | Date and time when the application was submitted |
| status | VARCHAR(20) | Current application status |
| Column | Type | Description |
|---|---|---|
| certification_idPK | INT | Unique certification record identifier |
| application_id | INT | Application associated with the certification |
| certified_at | TIMESTAMP | Date and time when certification was completed |