You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The solution for calculating low stock (in screen 4) is wrongly sorted in ascending order.
The code:
SELECT productCode,
ROUND(SUM(quantityOrdered) * 1.0 / (SELECT quantityInStock
FROM products p
WHERE od.productCode = p.productCode), 2) AS low_stock
FROM orderdetails od
GROUP BY productCode
ORDER BY low_stock
LIMIT 10;
wrongly assumes that a higher priority for restocking is given to products with a lower "low_stock" value.
The code clearly shows that a lower value will correspond with a lower quantityordered and/or higher quantityInStock. This is clearly against the purpose stated in the project's instructions.
A simple correction can be made to the code by simply sorting by descending
The text was updated successfully, but these errors were encountered:
The solution for calculating low stock (in screen 4) is wrongly sorted in ascending order.
The code:
wrongly assumes that a higher priority for restocking is given to products with a lower "low_stock" value.
The code clearly shows that a lower value will correspond with a lower quantityordered and/or higher quantityInStock. This is clearly against the purpose stated in the project's instructions.
A simple correction can be made to the code by simply sorting by descending
The text was updated successfully, but these errors were encountered: