Should junction tables have more than one primary keys from another identifying table?

后端 未结 4 617
野趣味
野趣味 2021-01-16 04:43

Here\'s an example: Originally I have 3 tables. Table B references Table A. So now Table B has two primary keys. One used as the original primary key and the other one to en

4条回答
  •  礼貌的吻别
    2021-01-16 05:33

    each table should only have one primary key which is only about this table. If you then want a second column in Table A containing the values of the table B primary key thats find. Just set up a second index to get performance if requires

提交回复
热议问题