TresVista interview question

Python basics ,sql queries and puzzles.