1.

Suppose the last row has the AUTO_INCREMENT column value 32. Suppose a new row is added by setting AUTO_INCREMENT value equal to 100. The next row added will have value _____________(a) 32(b) 33(c) 100(d) 101I have been asked this question in a job interview.Origin of the question is Working with Sequences topic in division Data Types of MySQL

Answer»

Correct option is (d) 101

To elaborate: If the NEW value is larger than the current NEXT sequence number, then the sequence is RESET to CONTINUE with the next value after that for the following rows. In this WAY, “bumping up” the counter is done.



Discussion

No Comment Found

Related InterviewSolutions