• Welcome! The TrekBBS is the number one place to chat about Star Trek with like-minded fans.
    If you are not already a member then please register an account and join in the discussion!

Anyone know Databases and willing to help me with some homework?

The Fatman

Captain
Captain
I am doing a homework project for an Access Databases class, and need to design a database in 3rd normal form for a fictional computer repair company. She says it just needs to be very basic, only 6-10 tables. The problem I am running into is connecting my tblInvoice with my tblParts.

tblInvoice has InvoiceID (primary key), Date, Paid(Y/N), Balance, CustID (foreign key - tblCustomer) and PartID (foreign key - tblParts)

Long story short, how do I account for the posibility of multiple part ID's on the invoice (if necessary)? Do I need to put multiple partID fields on tblInvoice? I emailed the teacher for help, and she told me I wasn't normalized enough and to think of it like a "class registration system"... which didn't help me any. I'd appreciate any thoughts anyone could offer me :bolian:
 
Create another table called tblInvoiceParts. It will have two columns:

Invoice - Reference to an InvoiceID in tblInvoice.
Part - Reference to a PartID in tblParts.

Don't have PartID in tblInvoice--save it for tblInvoiceParts.

Generally speaking, if you have a field that may need multiple values, you should set it up as a child table with one of the columns pointing back to the parent table, and the other column holding the actual data you want (be it an ID for another table, or a data value like a phone number.)

Database normalization is one of my specialties. ;) I hope that helps! Let me know if you need further guidance.
 
If you are not already a member then please register an account and join in the discussion!

Sign up / Register


Back
Top