Relationship using the same field

G

Guest

I have one table that lists every Shipper/Consignee my company deals with,
which provides address, phone number, etc.

I first created separate Shipper and Consignee tables to uniquely refer to
each record in another table using a primary key record ID. This is stupid
though since the data within each Shipper and Consignee table is identical.

How can I use one reference table and still be able to uniquely identify the
Shipper and Consignee, even though Shipper = Consignee in that reference
table?
 
D

Dirk Goldgar

Rich said:
I have one table that lists every Shipper/Consignee my company deals
with, which provides address, phone number, etc.

I first created separate Shipper and Consignee tables to uniquely
refer to each record in another table using a primary key record ID.
This is stupid though since the data within each Shipper and
Consignee table is identical.

How can I use one reference table and still be able to uniquely
identify the Shipper and Consignee, even though Shipper = Consignee
in that reference table?

I'm not sure I see the problem. You can have multiple fields in one
table related to the same field in another table. For example, you
could have

table ShippersAndConsignees
-------------------------------
SCID (primary key)
SCName
SCAddress
SCCity
SCState
SCZip
SCPhone

table Orders
-------------
OrderID (primary key)
OrderDate
... other fields ...
ShipperID (foreign key : ShippersAndConsignees.SCID)
ConsigneeID (foreign key : ShippersAndConsignees.SCID)

If this isn't the sort of thing you're talking about, please explain in
more detail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top