Pregunta de entrevista de eBay

Please finish this assignment by using SQL command or logic.