Using an AUTO_INCREMENT Column to Create Multiple Sequences
mysql>
mysql> CREATE TABLE bug
-> (
-> id INT UNSIGNED NOT NULL AUTO_INCREMENT,
-> name VARCHAR(30) NOT NULL, # type of bug
-> PRIMARY KEY (name, id),
-> date DATE NOT NULL, # date collected
-> origin VARCHAR(30) NOT NULL # where collected
-> );
Query OK, 0 rows affected (0.01 sec)
mysql>
mysql>
mysql> drop table bug;
Query OK, 0 rows affected (0.00 sec)
Related examples in the same category