Challenge - 5 Problems
Math Functions Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ query_result
intermediate2:00remaining
Output of ROUND function with decimal places
What is the output of this SQL query?
SELECT ROUND(12.3456, 2);
PostgreSQL
SELECT ROUND(12.3456, 2);
Attempts:
2 left
💡 Hint
ROUND rounds the number to the specified decimal places.
✗ Incorrect
ROUND(12.3456, 2) rounds the number to 2 decimal places, resulting in 12.35.
❓ query_result
intermediate2:00remaining
Output of CEIL function on negative decimal
What is the output of this SQL query?
SELECT CEIL(-3.7);
PostgreSQL
SELECT CEIL(-3.7);
Attempts:
2 left
💡 Hint
CEIL returns the smallest integer greater than or equal to the number.
✗ Incorrect
CEIL(-3.7) returns -3 because -3 is the smallest integer greater than or equal to -3.7.
❓ query_result
advanced2:00remaining
Output of FLOOR function with positive decimal
What is the output of this SQL query?
SELECT FLOOR(7.999);
PostgreSQL
SELECT FLOOR(7.999);
Attempts:
2 left
💡 Hint
FLOOR returns the largest integer less than or equal to the number.
✗ Incorrect
FLOOR(7.999) returns 7 because 7 is the largest integer less than or equal to 7.999.
❓ query_result
advanced2:00remaining
Output of ABS function on negative integer
What is the output of this SQL query?
SELECT ABS(-15);
PostgreSQL
SELECT ABS(-15);
Attempts:
2 left
💡 Hint
ABS returns the absolute value of the number.
✗ Incorrect
ABS(-15) returns 15 because absolute value removes the negative sign.
🧠 Conceptual
expert3:00remaining
Understanding combined use of ROUND, CEIL, FLOOR, and ABS
Given the query:
What is the output?
SELECT ROUND(CEIL(-2.3) + FLOOR(3.7) + ABS(-4.5), 0);
What is the output?
PostgreSQL
SELECT ROUND(CEIL(-2.3) + FLOOR(3.7) + ABS(-4.5), 0);
Attempts:
2 left
💡 Hint
Calculate each function step-by-step before adding and rounding.
✗ Incorrect
CEIL(-2.3) = -2, FLOOR(3.7) = 3, ABS(-4.5) = 4.5; sum = -2 + 3 + 4.5 = 5.5; ROUND(5.5,0) = 6.