magicpin interview question

asked me a simple query based on Sql window function