今天在建表的時候,看到這樣一個語句:
create table `books`(
??????? `bookID` int(10) not null auto_increment comment '書id',
??????? `bookName` varchar(100) not null comment '書名',
??????? `bookCounts` int(11) not null comment '數(shù)量',
??????? `detail` varchar(200) not null comment '描述',
??????? key `bookID` (`bookID`)
)engine=innodb default charset=utf8
其中key的作用是什么?參考下面兩個鏈接。
https://developer.aliyun.com/ask/58746?spm=a2c6h.13159736
https://www.cnblogs.com/zjfjava/p/6922494.html