The CEILING function returns the smallest integer that is greater than or equal to the supplied numeric expression.
Rounding values upward is useful when calculations require whole units, minimum quantities, or capacity estimates.
Round the required number of delivery boxes upward.
SELECT
ProductID,
RequiredUnits,
CEILING(RequiredUnits / 10.0) AS BoxesRequired
FROM InventoryRequirements;
CEILING is useful in inventory planning, packaging, capacity planning, financial calculations, and resource allocation.
- CEILING rounds upward.
- It returns the smallest integer greater than or equal to the value.
- Positive decimal values are rounded upward.
- It is useful for capacity calculations.
- Some databases provide CEIL as an alternative name.
What does CEILING do?
CEILING returns the smallest integer greater than or equal to the supplied number.
When would you use CEILING?
CEILING is useful when partial units must be converted into complete units, such as boxes, seats, or capacity slots.