Amazon interview question

SQL Join , group by questions Live coding.