Saturday, May 16, 2009

Answer the questions with the following assumption

The structure of table view buyers is as follows:

+-------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+----------------+
| user_pri_id | int(15) | | PRI | NULL | auto_increment |
| userid | varchar(10) | YES | | NULL | |
+-------------+-------------+------+-----+---------+----------------+

The value of user_pri_id of the last row is 2345. What will happen in the following conditions?

Condition 1: Delete all the rows and insert another row. What is the starting value for this auto incremented field user_pri_id?

Condition 2: Delete the last row (having the field value 2345) and insert another row. What is the value for this auto incremented field user_pri_id?

In both conditions, the value of this auto incremented field user_pri_id is 2346.

No comments:

Post a Comment