Citi interview question

Python and SQL query questions