I posted this at ServerFault and was told this would be a better spot for it.
I have some experience as a developer but am a complete novice when it comes to SQL administration and database design.
I'm converting my company's ordering and quoting process from a excel spreadsheet to something a little more robust using an ASP.NET application with a SQL backend.
Currently our parts database is just a excel spreadsheet. A lot of our products are just off-the shelf hardware from OEM's like routers, servers etc. We are primarily a software shop so we install our applications on the equipment, configure the network equipment and ship out a complete solution that is installed by our techs.
In my schema I have 5 tables
- CompanyProducts
- OEMProducts
- SupplierProducts
- Suppliers
- OEMs
OEMProdcuts contains information from the equipment manufcaturer like Cisco, for networking equipment or Dell for server equipment.
SupplierProducts contains information about the suppliers we get the OEM stuff from (since a lot of OEM's use resellers)
companyProducts contains the product ID's specific to our company.
Here's a snapshot from SQL Server Management Studio:
My question is:
What's the best way to setup the primary keys for this simple schema? Should I use an auto-increment field as a GUID as shown in the diagram or the OEMProductID for the primary key to reference in all tables?
The Suppliers to SupplierProducts and OEMs to OEMProducts are obvious to me but the rest of the relationships I'm not so sure about. I'm a little worried that if I'll have to refer to OEMProducts by an obscure auto-generated ID when I add data to a table that references it. Since we have more than one supplier for many of the same equipment, I'm not sure how to model that relationship.
Thanks for your time.