Spotify interview question

Sql problem to use joint union