Amazon Interview Question

It was very basic sql