Write a basic SQL query structure to analyze tenant payment histories by status and month.
Use the tenant_payments table. Include records with a payment date, label missing payment statuses as Unknown, and exclude records without a payment date.
payment_month, payment_status, and payment_count.| Column | Type | Description |
|---|---|---|
| payment_idPK | INT | Unique payment identifier |
| tenant_id | INT | Identifier of the tenant associated with the payment |
| payment_date | DATE | Date on which the payment was recorded |
| payment_status | VARCHAR(30) | Payment processing status |
| amount | NUMERIC(10,2) | Payment amount |