SELECT CEIL(5.94); -- 6
SELECT CEIL(5.24); -- 6
SELECT CEIL(-5.24); -- -5
SELECT CEIL(-5.54); -- -5
We can use MySQL ceil() function to get the smallest integer not less than the input value.
SELECT AVG(mark) AS avg_mark FROM student;
Output = 74.6571
Now we can use ceil command like this.
SELECT CEIL(AVG(mark)) AS avg_mark FROM student;
Output = 75Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.