Click here to Skip to main content
15,890,043 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working to develop database model then the database for automobile parts importer. the company imports different car items from different suppliers. Each supplier is likely to have it own identification number for the same item. the problem the client faces issues in tracking orders of the same item and also needs compare offers the same items even though it is referred differently across different documents. after the purchase order, it needs to track the success /failure of orders from different suppliers. in order to approach the problem, I have made the following the database table.
<pre lang="SQL">
Suplier(ID, Name, Contact)
Item(ID,Item, Quantity)
ItemSuplier (ID, Item_ID(FK), Suplier ID, Identification Code, OE_Code, Description)

// Identification code indicates, the code identification used for items by suppliers which is different according to the supplier. The OE indicate the original automobile manufacturer used to differentiate the items.
Order (ID, Item ID, Qty)
Suborder(ID, order_ID, Supplier _ID, Qty, Price)
// the suborder indicate when the importer sends the order different suppliers send back the price of the item and how many they are going to provide. the suborder is, importer after comparing different price will send the confirmation order with the supplier they chose to send.
so my question is, this database table enough to address the problem? or need some change? second, how can make it in NeDB? I would appreciate if you give me your suggestions.

What I have tried:

I have been trying to build the database for a system in NeDb database
Posted
Updated 6-Jun-18 3:10am
v2

1 solution

Quote:
this database table enough to adress the problem? or need some change?
It's highly unlikely that this design will be sufficient and it you only have one table it is likely to be a bad design. Unfortunately your question is very difficult to read.

Here is a link to some example Automotive Industry database designs
Data Models - Automotive Industry[^] to show you how other people have gone about this, but beware, your tutor will be very familiar with the models on that link.

Telling how to make your database in any environment is off-topic for a Quick Answers forum. I suggest you refer to the author's documentation GitHub - louischatriot/nedb: The JavaScript Database, for Node.js, nw.js, electron and the browser[^]
 
Share this answer
 
Comments
Member 10651775 6-Jun-18 9:11am    
Thank you for your answer. sorry for my writing, I have edited well now. Does it require another database table which uses for tracking the order, when it shifts and where it reaches? or enough?
CHill60 6-Jun-18 10:29am    
I would have at least the following - a table for Supplier, a table for Item, a table that links items to suppliers.
I suggest studying a couple of examples on the link I gave you or even looking at similar models (on the same site) e.g. Aircraft Parts and Orders Data Model[^]
You might also find the following useful Database Design 101: How to Create a Database Model From Scratch[^]
Member 10651775 7-Jun-18 12:07pm    
Thank you for you answer. I realy appreciate your help. When you said you yhave one table bad,which table is that and why? Thank you
CHill60 7-Jun-18 12:13pm    
On your original question I thought you only had a single table - I now see that there are three tables so you can ignore the comment about one table. The comment meant that if you had only had a single table then the design would be bad.
I would probably have done the tables like this though...
Suplier(ID, Name, Contact)
Item(ID,Item, Quantity, [Identification Code], OE_Code, Description)
 ItemSuplier (ID, Item_ID(FK), Suplier ID)

In other words the ItemSuplier table only acts as a link and things that apply to every instance of each item is stored on the item table

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900