Citi interview question

SQL queries and sorting algorithms