Composite Key!!! Please Help Me

alireza1989@hot

Registered User.
Local time
Today, 11:03
Joined
Feb 26, 2007
Messages
23
Hi, I am in a great hurry and I need someone to help me as soon as possible. Basically, I have a table called Column, which contains 4 fields:
Column (autonumber, primary key)
Column Description (text)
Rack (number)
Rack Description (text)

There are around 30 columns, and each column has 3 racks. There are different racks for different columns, so the rack description will be different. That is why Rack and Rack Description must be in the same table as column.

The problem is that I cannot make the table have one column with three different racks. I thought perhaps the solution would be to make a composite key, where with Column and Rack, we would be able to identify everything else in the table. But the problem is that I do not know how to create this composite key. Please help me with this. I really need to get this done as soon as possible.

Thanx in advance
 
First to answer the question as asked.

Creating a composite primary key (PK) involves using standard Windows features to select the desired fields. So, say you wanted column and rack as your compound PK. For convenience you might want them adjacent. Which, in design mode, involves dragging rack to be next to column, then drop it, then save the table (before you muck about with the keys... Access gets peevish if you try too much at once.)

OK, once you have them together, hold down shift, click them both, and then click the toolbar' key icon. Presto, compound prime key.

OK, having said this, it smells denormalized. If rack depends on column then rack is NOT a proper candidate key or key member.

If this is what I think it is, you have

tblColumns
ColID, numeric, PK
ColDescr, text
etc

tbl Racks
RackID, numeric, PK member
ColID, numeric, PK member
RackDescr, text,
etc

Yeah, I know it seems wasteful and/or overly complex to have two tables, but what you described is accurately represented they way I showed you.
 
Well, I'm trying normalise another table, and that's why I made this new table for columns. But anyway, I dont think I can normolise the Column table because each column has three racks which are completely different from the three racks of another column. The other way you told me, compound primary key, worked perfectly.

Thanx a lot
 

Users who are viewing this thread

Back
Top Bottom