Amdocs interview question

Few sql queries.