Citi interview question

SQL tabling