Home > Back-end >  Two foreign key in a table at the same time corresponding to a primary key in another table
Two foreign key in a table at the same time corresponding to a primary key in another table

Time:03-21

Household register is the primary key of the user table User_id,
A trading business, such as two contract will use contract number in the table Compact_id (primary key), Seller_id the seller and the buyer Buyer_id are corresponding to the User_id, no?
How should solve?
Thanks!

CodePudding user response:

To do so is very normal ah, how do you not

CodePudding user response:

In actual business, generally do not recommend direct establish foreign key relationships, for the purpose of building table even two fields associated with another table ID at the same time, that is permitted.

CodePudding user response:

Ok, there is nothing wrong with this

CodePudding user response:

Upstairs are all back to you, ok

CodePudding user response:

Can completely,

CodePudding user response:

Thank you for your reply, but I do not know is to establish the foreign keys, always complains, a table's primary key made the foreign key in another table, do you want to be in the other table's foreign key can't do it

CodePudding user response:

Hello, are you still remember how to do
  • Related