Amazon interview question

SQL question on simple join