Amazon interview question

merchant and orders tables ,,,window function ,CASE statement