BatchData interview question

My manager asked me to write a SQL Query.