I am trying a understand and frame a SQLite schema for an Android app concept. The concept is a simple inventory management system. Coming to the schema, a SQLite table sku table contains the information related to the product being sold. The list of columns for this table include
- id
- product name
- cost price
- sale price
- available quantity
So this is where i am getting held up. The available quantity is initially null (no quantity exists until added by the user). Now, I add 100 units of that particular product to the inventory. Hence, the available quantity becomes 100. Now i sell 20 units. Hence, the available quantity becomes 80.
As a note, the number of units added to inventory i.e. 100 is stored in procurement table the number of units sold i.e. 20 is stored in sales table
My doubt is that how the math operation needs to be carried out. I mean where and how should the math operation need to be introduced?
Aucun commentaire:
Enregistrer un commentaire