connecting tables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how do I connect a data set in one table to another table that has an
information I need. for example how do I get the address of a client from one
table and attach it to another table that has the rest of the client's
details.
 
The clients table should have a field which uniquely identifies each client,
such as a numeric ClientID, as its primary key field. The other table should
also include a ClientID field as a foreign key. In a one-to-one relationship
the ClientID would also be the primary key of the second table, though in
most cases relationships are one-to-many, e.g. if the second table were an
Orders table each client can have many orders. The primary key of the
Clients table can be an autonumber field, but the foreign key in the second
table must be a straightforward long integer number data type, not an
autonumber.

To return data from both of the two tables you use a query which joins them
on the ClientID fields. What you should not do is repeat any data other than
the keys in both tables. This is redundancy, which leaves the door open to
update anomalies.

Ken Sheridan
Stafford, England
 
Back
Top