I have three tables:
PurchasesTable: PId, ItemId, PDate, ItemName, PQuantity, PPrice, PAmount.
SalesTable: SId, ItemId, SDate, ItemName, SQuantity, SPrice, SAmount.
I want to construct a query to make a StockTable: SDate, ItemId, ItemName, QuantityPurchased, QuantitySold, Balance.
The sample...