How to design the inventory table of the purchase, sale and storage system?

problem description

  • Design a purchase, sale and inventory system for a medium-sized multi-store seller; in order to improve sales opportunities and reduce the production of expired goods, items will be transferred back and forth among multiple stores;
  • goods have purchase prices and production batches; the purchase prices of different batches are different; there are N quantities for each batch of goods; even the purchase prices are different for different purchase channels of the same batch.

the environmental background of the problems and what methods you have tried

excuse me, how to design the inventory table? To achieve the following functions:

  1. Store profit statistics (sales-purchasing cost)
  2. shops transfer goods to each other
  3. retrieve inventory in real time
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c089bf-3291f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c089bf-3291f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?