Verisk Interview Question

Sql queries and some puzzles