Amazon Interview Question

SQL questions on basic joins and cte