Way To Java

Way To Java

Share

17/09/2017

Set the AUTO_INCREMENT value MySQL
--------------------------------------------------------

- By default MySQL will generate the value of AUTO_INCREMENT column value to 1.

- To start with an AUTO_INCREMENT value other than 1, set that value with CREATE TABLE or ALTER TABLE.

- For New Table

mysql> CREATE TABLE student
-> (
-> id INT UNSIGNED NOT NULL AUTO_INCREMENT = 1000,
-> PRIMARY KEY (id),
-> name VARCHAR(30) NOT NULL
);

- For Existing Table-

mysql> ALTER TABLE tbl AUTO_INCREMENT = 1000;

Want your school to be the top-listed School/college in Noida?
Click here to claim your Sponsored Listing.

Category

Address


Noida