0
0
MySQLquery~20 mins

ROUND, CEIL, FLOOR in MySQL - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Master of ROUND, CEIL, FLOOR
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
2:00remaining
Output of ROUND function with decimals
What is the output of the following MySQL query?

SELECT ROUND(12.3456, 2) AS rounded_value;
MySQL
SELECT ROUND(12.3456, 2) AS rounded_value;
A12
B12.34
C12.346
D12.35
Attempts:
2 left
💡 Hint
ROUND rounds the number to the specified decimal places.
query_result
intermediate
2:00remaining
Output of CEIL function with negative decimal
What is the output of this MySQL query?

SELECT CEIL(-3.7) AS ceil_value;
MySQL
SELECT CEIL(-3.7) AS ceil_value;
A-3
B-4
C-3.7
D-2
Attempts:
2 left
💡 Hint
CEIL returns the smallest integer greater than or equal to the number.
query_result
advanced
2:00remaining
Output of FLOOR function with positive decimal
What is the output of this MySQL query?

SELECT FLOOR(7.999) AS floor_value;
MySQL
SELECT FLOOR(7.999) AS floor_value;
A7.999
B8
C7
D0
Attempts:
2 left
💡 Hint
FLOOR returns the largest integer less than or equal to the number.
🧠 Conceptual
advanced
2:00remaining
Difference between CEIL and FLOOR for negative numbers
Which statement correctly describes the difference between CEIL and FLOOR functions when applied to negative decimal numbers in MySQL?
ACEIL rounds towards zero, FLOOR rounds away from zero.
BCEIL returns the smallest integer greater than or equal to the number, FLOOR returns the largest integer less than or equal to the number.
CCEIL and FLOOR both round up for negative numbers.
DCEIL and FLOOR both round down for negative numbers.
Attempts:
2 left
💡 Hint
Think about how CEIL and FLOOR behave on negative decimals.
📝 Syntax
expert
2:00remaining
Identify the syntax error in ROUND usage
Which option contains a syntax error when using the ROUND function in MySQL?
ASELECT ROUND(15.678 1);
BSELECT ROUND(15.678, 1);
CSELECT ROUND(15.678);
DSELECT ROUND(15.678, 0);
Attempts:
2 left
💡 Hint
Check the syntax for function arguments and commas.