Amazon interview question

It was very basic sql