Write a query using window functions to find the most recent medical claim for each member in a database.
Use the provided members and medical_claims tables. Return members with at least one claim, selecting the greatest claim date and using the highest claim ID to break date ties.
member_id, member_name, claim_id, claim_date, claim_type, claim_statusmember_id ascending| Column | Type | Description |
|---|---|---|
| member_idPK | INT | Unique member identifier |
| member_name | VARCHAR(100) | Member's full name |
| member_status | VARCHAR(20) | Current membership status |
| VARCHAR(150) | Member email address |
| Column | Type | Description |
|---|---|---|
| claim_idPK | INT | Unique medical claim identifier |
| member_id | INT | Member associated with the claim |
| claim_date | DATE | Date the claim was submitted |
| claim_type | VARCHAR(50) | Type of medical service claimed |
| claim_status | VARCHAR(20) | Processing status of the claim |