Citi interview question

few questions using SQL, one Python question about array manipulation