Examveda

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. 101

Answer: Option D

Solution (By Examveda Team)

This question is about AUTO_INCREMENT in MySQL, which is used to automatically assign unique numbers to new rows in a table. Let's break down the scenario:
1. The last row has AUTO_INCREMENT value 32: This means the last row in the table was assigned the number 32.
2. A new row is added with AUTO_INCREMENT value 100: Normally, AUTO_INCREMENT would simply increment the last value, but you're manually setting it to 100.
3. The next row added will have value... Since you've overridden the automatic increment, the next row will pick up from the last manually assigned value.
Therefore, the correct answer is D: 101.

This Question Belongs to MySQL >> MySQL Miscellaneous

Join The Discussion

Related Questions on MySQL Miscellaneous