WNS-Vuram interview question

SQL Queries for given scenario