Топ-100
 
CerebroSQL

AUTO_INCREMENT

Database: MySQL

Topic

The AUTO_INCREMENT attribute can be used to generate a unique identity
for new rows:

Example

CREATE TABLE animals (
id MEDIUMINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
);

INSERT INTO animals (name) VALUES
('dog'),('cat'),('penguin'),
('lax'),('whale'),('ostrich');

SELECT * FROM animals;