Verisk interview question

Sql queries and some puzzles