ceil(): smallest integer which is higher than the input value

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 which is higher than the input value.

Same way we can use the floor function to get the highest integer which is lower than the input value.

We can use ceil function to our student table where we will calculate the average mark of the students.
SELECT avg(mark) as avg FROM `student` 
Output = 74.6571 Now we can use ceil command like this.
SELECT ceil(avg(mark)) as avg FROM `student`
Output = 75

SQL Math References Floor function to get Maximum integer value Average value Query
Subhendu Mohapatra — author at plus2net
Subhendu Mohapatra

Author

🎥 Join me live on YouTube

Passionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.



Subscribe to our YouTube Channel here



plus2net.com




SQL Video Tutorials










We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer