Reputation: 1
Simple question but seems very difficult for me. I need 2 foreign keys in my table and after, will use query builder to get specific columns that I need.
Here is an image:
Currently, the ProductID
already has a relation with my Products
table. What I want now is to have another relation with my CustomerID
to my CustomerProducts
table. Any idea or reference on how to do it?
Upvotes: 0
Views: 34
Reputation: 471
Why not just use code to create the foreign keys?
ALTER TABLE YourTable
ADD CONSTRAINT NameYourFK FOREIGN KEY (YourColumn) REFERENCES YourOtherTable (YourOtherIdentityColumn)
Upvotes: 1