when auto increment should used for a column | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

when auto increment should used for a column

auto increment gives some trouble when ui does not guess about next ai

5th Nov 2016, 7:07 PM
Karthik Keyan
Karthik Keyan - avatar
1 Answer
0
Auto increment should be used to increment IDs. As you usually don't select by ID, it's not disturbing if you have holes in your IDs because you deleted a row. When you insert stuff, you shouldn't choose a precise ID because as they are primary keys, they should always be different. Instead, you should choose default value and say it is an auto increment when you create your table.
5th Nov 2016, 7:18 PM
Pierre Varlez
Pierre Varlez - avatar