When creating a mysql dump containing the structure of my database, one of the tables shows the following:
CREATE TABLE `completedTransactions` (
`paymentId` i
KEY
is not unique, PRIMARY KEY
and UNIQUE KEY
are uniques.
Quoting the documentation of CREATE TABLE :
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.
Yes, the KEY
keyword is just an alias for the INDEX
keyword.
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
...
{INDEX|KEY} [index_name] [index_type] (index_col_name,...)
[index_option] ...
Source: MySQL Documentation: CREATE TABLE