Fractal interview question

On Python and SQL queries