ZipGo interview question

Complex SQl, Puzzles