3M interview question

2 sql and 2 python questions