PDA

View Full Version : Third Normal Formation, Problem


chaserracer83
Aug 3, 2012, 02:29 PM
Hello,

I am trying to make a database in third normal formation. For the most part I understand 3NF, but have a question about how to setup a certain find of relationship in 3NF...

I have a transaction table. Within this table it keeps track of the purchaser and the receiver of the item in the transaction. The purchaser can be the recevier or they could be different people.

I feel like creating two separate tables (one for purchaser and one for receiver) is not correct. I was thinking the correct way would be to have one customer table, but I am not sure.

I am creating the database within Microsoft Access and it only allows me to create one link between two tables... does anyone know the correct way to set this up?

Thank you,
Chase

ScottGem
Aug 3, 2012, 03:44 PM
You are correct you should have one Customer table. Your transaction table should have foreign keys for PurchaserID and ReceiverID. The way you create these relationships is with an alias. In the Relationships Window you add the Customers table twice. You then link from CustomerID to the two above IDs. In a query you do the same thing, add the customers table twice.

chaserracer83
Aug 8, 2012, 07:52 AM
You are correct you should have one Customer table. Your transaction table should have foreign keys for PurchaserID and ReceiverID. The way you create these relationships is with an alias. In the Relationships Window you add the Customers table twice. You then link from CustomerID to the two above IDs. In a query you do the same thing, add the customers table twice.

That makes sense. The fact I couldn't make the link in Access made me question myself. Adding the table twice worked perfectly. Thank you for your help.

ScottGem
Aug 8, 2012, 09:28 AM
Welcome