Primary Keys and Foreign Keys
From: David <no_at_e-mail.com>
Date: Sun, 13 Apr 2003 17:08:23 +0100
Message-ID: <3e998e98$0$4864$cc9e4d1f_at_news.dial.pipex.com>
I am trying to write SQL statements for the following tables.
Do I need to set Person_ID in Person and House_ID in House as a foreign key to reference the composite key in 'Lives'?
Date: Sun, 13 Apr 2003 17:08:23 +0100
Message-ID: <3e998e98$0$4864$cc9e4d1f_at_news.dial.pipex.com>
I am trying to write SQL statements for the following tables.
Person (Person_ID, Name, Age, Interests) House (House_ID, Name/Number, Address, City) Lives (Person_ID,House_ID, Time_Lived_At_House)
In the 'Lives' table, I have defined Person_ID and House_ID as a composite primary key, is this correct?
Do I need to set Person_ID in Person and House_ID in House as a foreign key to reference the composite key in 'Lives'?
Please could someone help answer these questions
Thank you
David
Received on Sun Apr 13 2003 - 18:08:23 CEST