DXC Technology interview question

Advance SQL question, SparkSQL, basic python.