I am looking for advice. I am developing a database for direct selling traders. What I have at the moment is a products table with all the products they can buy from the supplier. This list of products is the same for every trader. It has the buy cost for the trader and the selling cost that they trader should be selling it at.
What I am trying to do is, when they buy a product from the supplier, this gets added to their own individual stock levels. So if Trader A buys 5 apples, their stock level for apples will be 5. Trader B could buy 2 apples,their stock level for apples will be 2. And it wont affect each other.
When they record a sale of a product. ie. If Trader A sells 2 apples then their stock level for apples becomes 3. If they buy another 2 from the supplier, then its back to 5. Also, if their stock level for a product is 0, they can still sell the product but it goes into a negative amount, which them becomes a 'stock to buy list'.
I am struggling to design the tables so I can record individual trader stock levels. There could be anywhere up to 200 traders on the system eventually once they register.
Help please!
What I am trying to do is, when they buy a product from the supplier, this gets added to their own individual stock levels. So if Trader A buys 5 apples, their stock level for apples will be 5. Trader B could buy 2 apples,their stock level for apples will be 2. And it wont affect each other.
When they record a sale of a product. ie. If Trader A sells 2 apples then their stock level for apples becomes 3. If they buy another 2 from the supplier, then its back to 5. Also, if their stock level for a product is 0, they can still sell the product but it goes into a negative amount, which them becomes a 'stock to buy list'.
I am struggling to design the tables so I can record individual trader stock levels. There could be anywhere up to 200 traders on the system eventually once they register.
Help please!