diff --git a/task.sql b/task.sql index 038f671..02fa8a9 100644 --- a/task.sql +++ b/task.sql @@ -1,3 +1,15 @@ USE ShopDB; -- Create your stored procedure here +DELIMITER // + +CREATE PROCEDURE get_warehouse_product_inventory(IN ID INT) +BEGIN + SELECT Products.Name AS ProductName, ProductInventory.WarehouseAmount AS Amount + FROM ProductInventory + JOIN Products + ON ProductInventory.ProductID = Products.ID + WHERE ProductInventory.WarehouseID = ID; +END // + +DELIMITER ;