Fractal Interview Question

On Python and SQL queries