Multi-Column Primary Key in MySQL 5

后端 未结 3 507
清歌不尽
清歌不尽 2020-12-03 10:28

I\'m trying to learn how to use keys and to break the habit of necessarily having SERIAL type IDs for all rows in all my tables. At the same time, I\'m also do

3条回答
  •  囚心锁ツ
    2020-12-03 10:42

    The primary key is a unique value for the row. It makes no sense to include price, a value that could change. Imagine if you had to change a large range of prices, then all those primary key values would change. What a mess that would be!

提交回复
热议问题