why 2 keys in one table?

allenkt

New member
Local time
Today, 07:33
Joined
Oct 20, 2007
Messages
2
This is probably a really simple question but one that has me stumped. At school we were given a database project where the professor apparently just assumed we have an understanding of Access. It is a fairly simple project (using the RollingThunder DB) and I have been able to figure most of it out using various tutorial online. But there is one thing I can't figure out.

I ran a query using only 2 tables, Customer and CustomerTransaction. The CustomerID field is the primary key in both tables but in the CustomerTransaction table the TransactionData field also has the key icon next to it. But I don't understand how this can be. I thought that each table could only have one primary key and that the only other type of key is the foreign key but that doesn't have the key icon, only the line indicating a relationship.

Oh, and btw, I'm using Access 2007.

So what does it mean that this other field has a key as well?

Thanks,
Karl
 
You are right that one table can only have one primary key - but the primary key may consist of more than one field. That is what you see, one primary key consisting of the CustomerID field and the TransactionData field. Meaning you can have duplicate customers and duplicate transaction data, but the combination of them must be unique.

I'm assuming your course also contains a "theory" part, in which this should have been covered ;)
 
Thanks for the reply, that makes sense :)

As for the course, it is part of an MBA course and this class is supposed to be just an overview of information systems. This project came out of the blue because we have not even talked about Access, we are on day 3 and have pretty much just talked about hardware, software and technology. So most of my class is struggling with this now too. But the professor did his PhD on some database technology so I guess he just assumes we know all this stuff. Thank God for forums! lol.

Karl
 

Users who are viewing this thread

Back
Top Bottom