DBA가 되고 싶은 병아리
오라클 시퀀스와 동일한 개념 AUTO_INCREMENT 본문
https://dev.mysql.com/doc/refman/8.0/en/example-auto-increment.html
MySQL :: MySQL 8.0 Reference Manual :: 3.6.9 Using AUTO_INCREMENT
3.6.9 Using AUTO_INCREMENT The AUTO_INCREMENT attribute can be used to generate a unique identity for new rows: CREATE TABLE animals ( id MEDIUMINT NOT NULL AUTO_INCREMENT, name CHAR(30) NOT NULL, PRIMARY KEY (id) ); INSERT INTO animals (name) VALUES ('do
dev.mysql.com
CREATE TABLE animals
( id MEDIUMINT NOT NULL AUTO_INCREMENT, name CHAR(30) NOT NULL, PRIMARY KEY (id) );
일련번호나 회원번호와 같이 자동으로 증가하는데 사용하는 것이 알맞을 듯 싶다.