Note that there are some explanatory texts on larger screens.

plurals
  1. POComments/Suggestions on database design - Warehouse Stock Management
    primarykey
    data
    text
    <p>I'm currently creating a stock management system that uses multiple warehouses (with sub locations) and since this is my first big project I would love some feedback.</p> <p>Let me show you what I have done so far... <a href="http://i1251.photobucket.com/albums/hh551/stackoverflowtemp/Database.png" rel="nofollow">Link as Im still new here</a></p> <p>You first need to create a Warehouse, then you can create a Location within that Warehouse.</p> <p>You can also create an ItemType (ItemGroup), then you can create an Item for that group.</p> <p>Once you have an Item and Location you can add Stock, the Stock table has a composite key so that duplicates cant be added. I also added a constraint so that you could not enter an Item of the wrong ItemType, same constraint on the Warehouses/Location. </p> <p>I then need to keep records of each piece of stock, SerialisedItems and NonSerialisedItems. Example: If non serialised stock is added with a quantity of 10 then I currently create 10 rows inside the NonSerialisedItems table (1) that are set to ‘in stock’ with the relevant stock information. If they change the amount of stock then rows would be deleted or added (2).</p> <p>I could also do with a Van table somewhere that is similar to Warehouse, but think I would have to change the Warehouse table to something like Storage that references two tables, Warehouse and Van?</p> <p><em>(1) I currently have a TransactionScope on my page adding x number of rows, Is this the best way to handle that? (2) The Quantity amount in the Stock table would have to count the number of rows for that item and then update the Quantity each time stock is added or removed, any problems here?</em> - <strong>Both Questions Fixed - Only create rows for serialised items.</strong></p> <p><strong>Any other problems?</strong></p> <p>Well that’s what I have done, if its good or terrible let me know. Also if there are any pitfalls I should be looking out for that would also be great to know.</p> <p>Thanks</p> <p><strong>[EDIT]</strong> Thanks to Neville K I have made a few changes...</p> <p><a href="http://i1251.photobucket.com/albums/hh551/stackoverflowtemp/Database2.png" rel="nofollow">Link to new and improved database</a></p> <p>This seems to make a lot more sense! Think I had been staring at it to long yesterday!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload