Skip to content
SQLSimplified
numeric

CEIL()

Rounds a number up to the nearest integer (ceiling).

Description

CEIL (also spelled CEILING) rounds a number up to the smallest integer greater than or equal to it. Use it when you need to "round up" — for example, calculating how many boxes you need if each holds 10 items.

Syntax

CEIL(expression)
CEILING(expression)

Parameters

NameDescriptionOptional
expressionA numeric column or expression.No

Return Type

Returns an integer type. The fractional part is discarded by rounding upward.

Examples

Store (Customers/Orders/Products)

Loading database engine...

Store (Customers/Orders/Products)

Loading database engine...

CEIL vs FLOOR

CEIL always goes up (toward positive infinity); FLOOR always goes down. CEIL(-2.7) is -2, while FLOOR(-2.7) is -3.

Common Mistakes

  • Confusing with rounding. CEIL doesn't round to the nearest integer; it always moves up. Use ROUND for nearest.
  • Negative numbers. CEIL(-2.7) is -2, not -3 — it moves toward positive infinity.
  • Expecting decimals. The result is an integer.

See also: FLOOR, ROUND.

Search

Search lessons, functions, examples, and practice problems