Want to know the scenario where we need to reset the autoincrement value in database. If possible (Real life example I'm looking for).
There's no scenario where you need this. There are zero valid scenarios for that in this universe.
People will try to come up with a reason, but that reason won't be valid.
auto_increment
:
auto_increment
value.Therefore, the need to reset it doesn't exist. If you have the need to do so, you're using auto_increment
wrong.
During development, you might want to truncate your tables to re-start the counter from 1, just to satisfy your own OCD. I do it too, but the reason isn't really valid and nothing happens if you leave it be.