By default, it sorts the data in ascending get and commences assigning ranks for each row. In the above mentioned screenshot, we get ROW No 1 for marks fifty. We will specify descending order with Buy By clause, and it adjustments the RANK accordingly. We use ROW_Number() SQL RANK functionality https://eatatstreet.com