Two foreign keys instead of primary

后端 未结 8 1604
陌清茗
陌清茗 2020-12-17 21:28

I was wondering, is there any possibility to create a table without a primary key, but with two foreign keys, where the foreign keys pairs are always different? For example,

相关标签:
8条回答
  • 2020-12-17 22:19

    You want a compound primary key.

    0 讨论(0)
  • 2020-12-17 22:21

    If you aren't doing any sort of query that needs it, you don't need a primary key. It makes it a tiny bit harder to delete a record unambiguously, though. You might want to put a unique constraint on item_id,warehouse_id if Oracle allows that.

    0 讨论(0)
提交回复
热议问题