Amazon interview question

SQL questions on basic joins and cte