MiQ interview question

SQL questions on sub query, rank