Optiver interview question

2 Sql query questions and 2 Python questions