Cognizant interview question

Solving Complex Queries in sql