meaning of a KEY in CREATE TABLE statment in mysql
It is simply a synonym for INDEX
. It creates an index with the name ndx_PickupSPC
on the columns specified in parenthesis.
See the CREATE TABLE
syntax for more information.
Key and index are the same. The word Key
in the table creation is used to create an index, which enables faster performance.
In the above code, Key ndx_PickupSPC
means that it is creating an index by the name ndx_PickupSPC
on the columns mentioned in parenthesis.
It's just a non-unique index. From the manual
KEY is normally a synonym for INDEX. The key attribute PRIMARY KEY can also be specified as just KEY when given in a column definition. This was implemented for compatibility with other database systems.