BatchData Interview Question

My manager asked me to write a SQL Query.