eBay interview question

Please finish this assignment by using SQL command or logic.