在create table的语句中,key和index混淆在一起,官方手册中的解释是这样:
KEY
is normally a synonym forINDEX
. The key attributePRIMARY KEY
can also be specified as justKEY
when given in a column definition. This was implemented for compatibility with other database systems.KEY通常是INDEX的同义词。当在列定义中给出时,键属性PRIMARY KEY也可以被指定为KEY。这是为了与其他数据库系统兼容而实现的。