Pregunta de entrevista de Amazon

SQL questions on basic joins and cte