Amdocs Interview Question

SQL query, python code, test case.