Uber interview question

SQL questions that were tricky to solve, although not programmatically difficult.