A Procedure to Restock Products
EasyDescription
Create a procedure pr_restock with two parameters, a product id and a quantity, in that
order. Each call adds the quantity to that product's stock and makes the product available
(is_available becomes true). No other product changes.
Then finish with exactly these statements:
CodeCALL pr_restock(4, 25); CALL pr_restock(26, 10); SELECT product_id, stock, is_available FROM products WHERE product_id IN (4, 8, 26) ORDER BY product_id;
Tables
| products |
|---|
| product_id (PK) |
| product_name |
| stock |
| is_available |