CEIL() function returns the nearest smallest integer that is greater than or equal to a number. Some database servers use the
CEILING() function, which is equivalent to the
CEIL() function. Figure 1 shows the mathematical representation of the
This function requires a number or a numeric value as a parameter.
CEIL() returns the nearest smallest integer that is greater than or equal to a number sent as a parameter.
/*example showing how to use CEIL(X)*/ -- positive number select CEIL(3.13); -- negative number select CEIL(-2.78);
Now, consider another example in which the teacher wants to round up the marks of the students.
The figure below shows the student table, followed by the query that rounds up the marks.
/*Query returns the marks of all the students after applying CEIL() */ select studentID, studentName, CEIL(studentMarks) as studentMarks from Students
View all Courses