Identification of foreign key [message #1547] |
Fri, 10 May 2002 23:23 |
pinky
Messages: 26 Registered: May 2002
|
Junior Member |
|
|
Hello,
I have a table say
Location with fields locationid, name and managername
and primary key is locationid
I have another table say worker with fields workerid,workername,locationid,managername and primary key is workerid.In this table locationid is the foreign key which refers table location.Also managername is a redundant field which comes from location table.I added this field intentionally for the sake of better software performance.
Can I identify locationid and managername as foreignkey in worker table after I create a unique index of locationid and managername in location table ?
Or only locationid is the foriegn key and managername is not even part of the foreign key?
Thanks...
|
|
|
|
Re: Identification of foreign key [message #1550 is a reply to message #1547] |
Sat, 11 May 2002 00:46 |
pinky
Messages: 26 Registered: May 2002
|
Junior Member |
|
|
So according to I should have locationid and managername as foreign key. Please clarify ?
Please note I'am defining the foreign key logically and not physically. I'am trying to correctly identify foreign key logically.
|
|
|
Re:PROPER Identification of foreign key [message #1552 is a reply to message #1550] |
Sat, 11 May 2002 22:05 |
pinky
Messages: 26 Registered: May 2002
|
Junior Member |
|
|
Hello ,
The correct identification of primary key of location table is locationid alone.
Do you think I should call locationid and managername as foreign key in table worker.If you think so then I can create unique index of locationid and managername in table location. My problem is that can I identify logically locationid and managername as foreignkey in table worker?
Awaiting response.
Thanks...
|
|
|