今天在建表的时候,看到这样一个语句:
create table `books`(
`bookID` int(10) not null auto_increment comment '书id',
`bookName` varchar(100) not null comment '书名',
`bookCounts` int(11) not null comment '数量',
`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