floor() : Highest integer lower that the input

SELECT FLOOR(80.41); => 80
Floor MySQL function returns the highest integer which is lower than the input value. This can be easily understood by some examples.
select floor(5.89)  => 5
select floor(5.22)   =>5
select floor(-5.89)   =>-6
select floor(-5.12)   =>-6
As you can see in above command gives highest integer which is lower than the input value.

We will apply our floor command to our student table. We will take average ( avg ) value of all marks secured by students and to that we will apply floor command. Let us first try without floor.
SELECT avg(mark) as avg FROM `student` 
Output = 74.6571

Now we can use floor command like this.
SELECT floor(avg(mark)) as avg FROM `student`
Output = 74
SQL Math References CEIL function to get lowest 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
kathir

07-06-2012

Thanks for your kind work




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