A self-join or nested query is often required for queries th…