Using Sequences


  1. When no AUTO_INCREMENT value has been generated during the current connection, LAST_INSERT_ID() returns ____________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    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.


  1. The value of recently generated sequence number can be obtained by ____________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The value of most recently generated sequence number can be obtained by calling the LAST_INSERT_ID() function. This enables to reference the AUTO_INCREMENT value in the subsequent statement.



  1. The AUTO_INCREMENT sequences normally begin at __________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The AUTO_INCREMENT column attribute provides unique numbers for column identification. AUTO_INCREMENT sequences normally begin at 1 and increase monotonically like 1, 2, 3, and so on.


  1. There can be only one column per table with the AUTO_INCREMENT attribute.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    In MySQL, there can only be one column per table with the AUTO_INCREMENT attribute. It should also have an integer data type. The AUTO_INCREMENT is also allowed for floating point types.



  1. Which column attribute provides unique numbers for identification?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    In MySQL, the mechanism for providing unique numbers is through the AUTO_INCREMENT column attribute. It enables the generation of sequential numbers automatically. This facilitates identification.