Pregunta de entrevista de BatchData

My manager asked me to write a SQL Query.