Simple relationships problem (easy for the experts)

PTRACER

Registered User.
Local time
Today, 12:31
Joined
Feb 18, 2008
Messages
48
Hi there,

I'm creating a database for my computer repair business and it's going to store details on my customers, their computers, and any repairs I carry out on them.

I've created some tables, but I'm unable to create the relationships I require between the tables. Here's what I have:

helpbk3.jpg


I want to create a one-to-many relationship between the tables left to right, excluding the Engineer table, which I will talk about in a moment.

The idea is - One customer has "many" computers, one computer has "many" repairs, one repair has "many" problems. Each repair has just ONE engineer assigned to it, although the engineer will be assigned to many repairs.

I can link the Customer and Computer tables, via the CustomerID, but when I try to connect the other tables, I get the "Relationship Type: Indeterminate" error.

Can anyone help me with what fields I need in each table, and what relationships I need to achieve what I need?

Many thanks :)
Paul
 
Your diagram suggests you've got composite primary keys defined (multiple columns combined into a single key/index) and I suspect this is causing the problem.
You only need the customerID, ComputerID, RepairID, problemID and engineerID respectively defined as the primary keys in your tables.
 
Ah ha, thanks. It's all so obvious now...I was defining foreign keys as primary keys and that's where my problem was.
 

Users who are viewing this thread

Back
Top Bottom