Morgan Stanley interview question

List comprehensions, SQL joins and some random questions