Packing Into Boxes of 12
EasyDescription
The warehouse packs products in boxes of 12. For each product, show product_name,
stock and:
full_boxes: how many boxes of 12 can be filled completelyloose_units: the units left over after filling themboxes_needed: the boxes needed to pack every unit, where a part-filled box also counts (a product with no stock needs 0)
End your query with ORDER BY product_id.
Tables
| products |
|---|
| product_id (PK) |
| product_name |
| stock |