BNP Paribas interview question

Write select queries for correlated sub query