Amdocs Interview Question

sql, programming, one tricky question