Amazon interview question

Two trivia SQL questions