Goldman Sachs interview question

Some query about SQL and Python