mysql>CREATE TABLE tb(
->id SMALLINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
->username VARCHAR(20) NOT NULL
->);
注意:自动编号Auto_INCREMENT必须与主键PRIMARY KEY组合使用
INCREMENT:增加的意思
mysql>CREATE TABLE tb(
->id SMALLINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
->username VARCHAR(20) NOT NULL
->);