Write a SQL query to join loan applications and customer tables and calculate the approval rate by month.
Use the provided tables and calculate approval rate as approved applications divided by all joined applications. Applications with a NULL customer_id or no matching customer are ignored.
application_month, total_applications, approved_applications, and approval_rate_pct.application_month ascending.| Column | Type | Description |
|---|---|---|
| application_idPK | INT | Unique loan application identifier |
| customer_id | INT | Customer associated with the application |
| application_date | DATE | Date the loan application was submitted |
| application_status | VARCHAR(30) | Current application decision status |
| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer full name |
| customer_state | VARCHAR(2) | Two-letter customer state code |