Database Normalization

I'm setting up a new database with the following types of orders

Purchase Orders (sent to manufacturer for inventory)
Sales Orders (received from customers)

The manufacturers will get reports of when/where their items are sold but I don't understand how I'll connect the two for reporting purposes

If I order 5 widgets for inventory at different costs over time - and 3 are sold - how do I know which widget went where....

Currently I have a field "SO_ID" on every "PO_ID" - and a "PO_ID" field on every "SO_ID" so when an item is picked and the serial number is captured they sync-up - but it just doesn't seem like the best way to do this.  It seems like the way I do it now has repeated data and that's what normalization tries to avoid.




ProdigyOne2kAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

johanntagleCommented:
Think you should have a third table for inventories, which will contain both po_id and so_id.  Each widget will have a row on the table and will also act as the join table between purchases and sales.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ProdigyOne2kAuthor Commented:
Ok

Now when trying to re-do our database I'm trying to follow all of the "rules" I'm reading about...and something I read was that no column should be "null".  Maybe this isn't a *must* - but just wanted to check that out as well

Of course the inventory will have a PO_ID right away - but the SO_ID would be "null" until it was committed to an order - is that a concern having a "null" SO_ID?
0
johanntagleCommented:
I don't know where you read that -> it's generally okay for a column to have null values unless it is the primary key.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.