Amazon interview question

SQL query databases using joins, groups, etc