Set AUTO_INCREMENT value
mysql>
mysql> CREATE TABLE CITY_NAMES
-> (SEQNO INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY,
-> NAME VARCHAR(30) NOT NULL)
-> AUTO_INCREMENT = 10
-> ;
Query OK, 0 rows affected (0.00 sec)
mysql> INSERT INTO CITY_NAMES VALUES (NULL, 'London')
-> ;
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO CITY_NAMES VALUES (NULL, 'New York')
-> ;
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO CITY_NAMES VALUES (NULL, 'Paris')
-> ;
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM CITY_NAMES;
+-------+----------+
| SEQNO | NAME |
+-------+----------+
| 10 | London |
| 20 | New York |
| 30 | Paris |
+-------+----------+
3 rows in set (0.00 sec)
mysql>
mysql>
mysql> drop table city_names;
Query OK, 0 rows affected (0.00 sec)
mysql>
Related examples in the same category