What is the ID of the claim that has the smallest amount of total settlement?
select t1.claim_id from claims as t1 join settlements as t2 on t1.claim_id = t2.claim_id group by t1.claim_id order by sum(t2.settlement_amount) asc limit 1
What is its effective date?
select t1.effective_date from claims as t1 join settlements as t2 on t1.claim_id = t2.claim_id group by t1.claim_id order by sum(t2.settlement_amount) asc limit 1
Show me the same for the effective date of claim with largest amount of total sum.
select t1.effective_date from claims as t1 join settlements as t2 on t1.claim_id = t2.claim_id group by t1.claim_id order by sum(t2.settlement_amount) desc limit 1