0
0
MySQLquery~5 mins

ROUND, CEIL, FLOOR in MySQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the ROUND() function do in MySQL?
The ROUND() function rounds a number to the nearest integer or to a specified number of decimal places.
Click to reveal answer
beginner
How does the CEIL() function behave?
CEIL() returns the smallest integer greater than or equal to the given number. It rounds numbers up.
Click to reveal answer
beginner
What is the purpose of the FLOOR() function?
FLOOR() returns the largest integer less than or equal to the given number. It rounds numbers down.
Click to reveal answer
beginner
How do you round the number 3.14159 to 2 decimal places using ROUND()?
Use ROUND(3.14159, 2) which returns 3.14.
Click to reveal answer
intermediate
What will CEIL(-2.3) and FLOOR(-2.3) return?
CEIL(-2.3) returns -2 (rounds up), FLOOR(-2.3) returns -3 (rounds down).
Click to reveal answer
What does ROUND(4.567, 1) return?
A4.6
B5
C4.5
D4
Which function rounds a number up to the nearest integer?
AFLOOR()
BROUND()
CCEIL()
DTRUNCATE()
What does FLOOR(7.9) return?
A0
B8
C7.9
D7
If you want to round 5.678 to the nearest integer, which function do you use?
AROUND()
BFLOOR()
CABS()
DCEIL()
What is the result of CEIL(-3.7)?
A-4
B-3
C-3.7
D-2
Explain the difference between ROUND(), CEIL(), and FLOOR() functions in MySQL.
Think about how each function treats decimal parts of numbers.
You got /3 concepts.
    How would you use ROUND() to round a number to 3 decimal places? Give an example.
    The second argument in ROUND controls decimal places.
    You got /2 concepts.