Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good day Guys,

I have a problem concerning normalization. I have 2 tables, one have locations and one has trips. in order a trip to be complete it consist of 2 locations and a location table is normalized. is it possible that my trip table can have 2 foreign keys? Your answers would be appreciated.
Posted

1 solution

Absolutely. In fact, that is a very common occurrance. Just go ahead and create both foreign keys in the table and all will be well. As Zoltan has pointed out in his comment to this question, this is actually a very natural and fundamental part of the normalization process. See this article for a decent explanation: Database normalization starts with the keys[^]
 
Share this answer
 
v3
Comments
Zoltán Zörgő 28-Jan-13 9:53am    
True. Just an addition: the normalization itself is the root cause of the growth of foreign keys in a table.
fjdiewornncalwe 28-Jan-13 9:55am    
Excellent point. I'll add that in.
Sergey Alexandrovich Kryukov 28-Jan-13 13:18pm    
Agreed, a 5.
—SA
fjdiewornncalwe 28-Jan-13 15:10pm    
Thanks, Sergey
Lulamile Gaji 29-Jan-13 2:16am    
I meant 2 foreign keys from the same table?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900