Merilytics Interview Question

4 Advance SQL question, 4 python, 3 puzzles.