AUTO INCREMENT

AUTO INCREMENT is used to generate a unique number when we insert a new record in the table.

Used to have a primary key of a table by automatically generating a unique sequence number in the table.

SQL Syntax AUTO INCREMENT

CREATE TABLE people { person int NOT NULL AUTO_INCREMENT, name varchar (255), surname varchar (255), nickname varchar (255) }

The initial value of an AUTO_INCREMENT value (AUTO_INCREMENT) is 1, and he is adding a new record each engraved on the table.

If we want the initial value is 100 instead of 1

ALTER TABLE people AUTO_INCREMENT=100

For SQL SERVER IDENTITY is used instead of AUTO_INCREMENT

To ACCESS is used instead of AUTO_INCREMENT AUTOINCREMENT

For ORACLE is defined differently

CREATE SEQUENCE person MINVALUE 1 START WITH 1 INCREMENT BY 1 CACHE 10