Spotify Interview Question

Sql problem to use joint union