Yes it is unique.
Attached ecart screenshots.
My current sql:
SELECT Quantity - (SELECT Coalesce(SUM(DetailQuantity),0) FROM orders Inner Join orderdetails ON orderdetails.DetailOrderID = orders.OrderID WHERE OrderDate > ProductUpdateDate AND DetailProductID = Products.ID) AS RemainingInventory FROM products INNER JOIN ProductBatch on products.ID = ProductBatch.ProductID WHERE ProductBatch.ProductID = %s