The SQL function CEILING() is used to round up a numeric value to the next highest integer. It returns the next whole value that is greater than or equal to the input value.


FROM table_name;
  • value - This is the value to be rounded up.


The following data is given in a temperatures table:

temp_id raw_temp
1 30.25
2 9.95
3 -5.7

The CEILING() function can be used to round up the raw temperatures:

SELECT temp_id, CEILING(raw_temp) AS ceil_temp
FROM temperatures;

The output will be:

temp_id ceil_temp
1 31
2 10
3 -5

All contributors

Looking to contribute?

Learn SQL on Codecademy