AUTO_INCREMENT sequences start at one
mysql>
mysql> CREATE TABLE t(
-> id INT UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY (id)
-> );
Query OK, 0 rows affected (0.01 sec)
mysql>
mysql> INSERT INTO t (id) VALUES(NULL);
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO t (id) VALUES(NULL);
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO t (id) VALUES(NULL);
Query OK, 1 row affected (0.00 sec)
mysql>
mysql> SELECT id FROM t ORDER BY id;
+----+
| id |
+----+
| 1 |
| 2 |
| 3 |
+----+
3 rows in set (0.00 sec)
mysql>
mysql> drop table t;
Query OK, 0 rows affected (0.00 sec)
Related examples in the same category