I have a column in a table that is auto incremented. Let’s call it employee_id.
Let the initial value be 1 and let it be incremented by 1 for each insertion.
After inserting 10 rows, the auto incremented value becomes 10 (employee_id is 10).
Now if I manually insert 11th row with an employee Id as 15 , and then allow MySql’s AUTO_INCREMENT to take over, will the next auto incremented value be 11 or 16 ?
It will be 16, bcs MySQL will update the value of AUTO_INCREMENT counter after each insert/update operation. This is for both most popular table engines, MyISAM and InnoDB: