MiQ Interview Question

SQL questions on sub query, rank