MySQL的自增长主键

如下DDL语句:

create table book(
id int(10) not null auto_increment,
name varchar(50) not null,
number varchar(20) not null,
author varchar(50) not null,
pubdate Date,
price float(7,1) not null,
category int(10),
primary key(id)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

AUTO_INCREMENT=1的意思是从1开始增长而不是每次增长1。

原文地址:https://www.cnblogs.com/Wcy100/p/5514967.html