If you have 100 rows,and deleted the 100th row. The next auto increment valueis supposed to be 101. If you want the next auto increment valueto be 100 instead, you can do the following.
Essentially, this alter statement will reset the next auto increment valueto the existing largest valuein the auto increment column+1
Scenario 2:
If you have 100 rows,and deleted the 20th row. The next auto increment valueis supposed to be 101. However,if you want your nextinsertto be inserted as#20, you can use the follow “set†command immediately before your INSERT statement.