Amdocs Interview Question

2 queries of sql