Aon interview question

Sql query