How would you create a formula for loan approvals based on a provided table of data?
Using the provided tables, write a SQL query that evaluates each loan application against the approval criteria and assigns an approval score and decision.
application_id, applicant_id, approval_score, and approval_decisionapproval_score descending, then application_id ascending| Column | Type | Description |
|---|---|---|
| application_idPK | INT | Unique loan application identifier |
| applicant_id | INT | Applicant identifier used to match credit data |
| vehicle_price | DECIMAL(10,2) | Price of the vehicle being financed |
| down_payment | DECIMAL(10,2) | Cash down payment offered by the applicant |
| annual_income | DECIMAL(12,2) | Applicant annual income |
| employment_years | DECIMAL(4,1) | Years at current employment |
| application_date | DATE | Date the application was submitted |
| Column | Type | Description |
|---|---|---|
| applicant_idPK | INT | Unique applicant identifier |
| credit_score | INT | Applicant credit score |
| debt_to_income | DECIMAL(5,2) | Applicant debt-to-income ratio |