Guy Carpenter interview question

Write SQL queries to solve data abstraction problem.