1.

When no AUTO_INCREMENT value has been generated during the current connection, LAST_INSERT_ID() returns ____________(a) -1(b) 0(c) 1(d) 2The question was asked in an interview for job.This is a very interesting question from Working with Sequences topic in chapter Data Types of MySQL

Answer»

Right choice is (b) 0

Easy EXPLANATION: The ‘LAST_INSERT_ID()’ FUNCTION RETURNS zero when no ‘AUTO_INCREMENT’ value has been generated during the current connection with the server. It is TIED to the current connection.



Discussion

No Comment Found

Related InterviewSolutions