Amazon interview question

SQL questions based on tables