Primary key versus key

后端 未结 3 1297
盖世英雄少女心
盖世英雄少女心 2021-02-07 19:19

When creating a mysql dump containing the structure of my database, one of the tables shows the following:

CREATE TABLE `completedTransactions` (
  `paymentId` i         


        
3条回答
  •  无人共我
    2021-02-07 20:21

    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

提交回复
热议问题