How to implement mysql? After deleting a record, rank of the record after it is automatically decreased by 1

  mysql, question

For example, I have data
user type rank
a 116 1
a 116 2
a 116 3
b 116 1
b 116 2
I now delete the records A, 116 and 2. I hope the rank of the records A, 116 and 3 will become 2. When I insert the records A and 116 again, the generated rank will be 3.

I think it is a problem of design thinking, and there should be no such requirement. Otherwise, if db has a lot of data, it will not update the whole table, which is too inefficient.

The landlord can say that the original requirements, if it is for sorting, in fact, do not need these values to be continuous.