I have a create table query in which there is a last clause which says AUTO_INCREMENT=5
Could someone explain what does that mean? below is the sample create table MySQL query
CREATE TABLE IF NOT EXISTS `uploaderdata` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`mdn` varchar(13) NOT NULL,
`service_request_id` varchar(10) NOT NULL,
`carrier` varchar(160) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'CHT',
`firstname` varchar(50) NOT NULL,
`lastname` varchar(50) NOT NULL,
`alt_contactnumber` varchar(13) NOT NULL,
`email` varchar(50) NOT NULL,
`document_files` longblob NOT NULL,
`make` varchar(20) NOT NULL,
`model` varchar(100) NOT NULL,
`casenumber` varchar(255) NOT NULL,
`dated` varchar(255) NOT NULL,
`fetched` tinyint(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
The auto_increment value of the first record starts with 5
instead of the default 1
.
The id
has an ongoing number for each record that starts from 5.
read the documentation first.. http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html
To start with an AUTO_INCREMENT value other than 1, you can set that value with CREATE TABLE or ALTER TABLE, like this:
mysql> ALTER TABLE tbl AUTO_INCREMENT = 100;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With