Amazon interview question

Simple to medium complexity SQL queries