Cognizant Interview Question

Sql codes and python code