Amazon Interview Question

Basic SQL queries around joins, grouping and some window functions