Next Insurance Interview Question

sql question like leetcode easy