Cognizant Interview Question

A sql query on joins