Can a foreign key act as a primary key?

前端 未结 2 676
走了就别回头了
走了就别回头了 2020-12-05 07:44

I\'m currently designing a database structure for our team\'s project. I have this very question in mind currently: Is it possible to have a foreign key act as a primary key

2条回答
  •  离开以前
    2020-12-05 08:36

    Yes, there should be no problem. Foreign keys and primary keys are orthogonal to each other, it's fine for a column or a set of columns to be both the primary key for that table (which requires them to be unique) and also to be associated with a primary key / unique constraint in another table.

提交回复
热议问题