Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can a "parent" table have more than one "child"

Status
Not open for further replies.

looperboy

Technical User
Dec 12, 2003
37
DE
can a "parent" table be linked to two "child" tables by the same primary key? I have a customers table, which I have tried to link to two seperate purchases tables- both of which hold a different category of product. The CustomerID in the Customers table is the primary key, linked to the customerID in both product tables- where it is the foreign key. But when I try to run queries using all three tables the results always come up empty.

Why is that?
 
why is that? because i dunno

i'd have to see your queries, and prefereably some sample rows

as far as your question is concerned, yes, a parent table can have any number of child tables

the parent table's primary key is referenced on the child's foreign key declaration


rudy
 
Why would you have two seperate purchases tables- both of which hold a different category of product? Why not just have one purchases table with a category field linked to a lookup table?

Leslie
 
Thanks for your comments. What was happening was the query interface was establishing a link between two of the tables automatically, which shouldn't have been there. All the comments letting me know that you can have more than one "child" table helped me to solve it.

To answer lespaul, the two tables are just because of how information comes into the database. I import text files from two different forms in two different locations, and it just makes it easier to import. The categories are also too diverse to have in one table. I usually work with the tables in totally different circumstances from each other.

thanks again,

looperboy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top