Inventory database maintaining remaining qty of an item
I'm not a sqlite expert, but I definitely think your database should be normalized further and you should store Quantity for an item on a separate table than the Sales table.  

Even though you've tagged your RDBMS as sqlite, I'd recommend having a look at the AdventureWorks table definitions to get an idea of how you might split your data attributes out to reduce data redundancy.  In the AdventureWorks database, the Quantity is stored in ProductInventory table.  

At a minimum, you could start with:


Customer Table - Contains current customer information. Customers are categorized by type: individual consumer or retail store.
SalesOrderHeader Table - Contains the general, or parent, sales order information. The specific products associated with the sales order are stored in SalesOrderDetail Table.
SalesOrderDetail Table - Contains individual products associated with a specific sales order. A sales order may include orders for multiple products. The general, or parent, information for each sales order is stored in SalesOrderHeader. Each product that is ordered, or child, is stored in SalesOrderDetail.
Product Table - Contains the products sold or used in the manufacturing of sold products.
ProductInventory Table - Contains the product inventory information.




Be sure to check out the other AdventureWorks table definitions as they may give you additional ideas about splitting out your data.