Allianz interview question

sql queries