Amazon Interview Question

Introduction, then to write a SQL query