Describe how you would perform a join on three separate tables.
Write a PostgreSQL query using the provided account, policy, and claim data. Return active policies, include matching claim details when available, and retain active policies with no matching claims.
Output
- One row per active policy and matching claim, or one row for an active policy without claims
- Columns:
policy_number, account_name, claim_id, claim_status, claim_amount
- Order by
policy_number, then claim_id, with policies without claims last