Amazon interview question

Basic queries on joins and correlation subqueries