eBay Interview Question

Please finish this assignment by using SQL command or logic.