Amazon Interview Question

All about SQL statements, not too much difficut.