0
0
PostgreSQLquery~5 mins

Mathematical functions (ROUND, CEIL, FLOOR, ABS) in PostgreSQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the ROUND function do in PostgreSQL?
The ROUND function rounds a numeric value to the nearest whole number or to a specified number of decimal places.
Click to reveal answer
beginner
How does the CEIL function behave in PostgreSQL?
The CEIL (ceiling) function returns the smallest integer greater than or equal to the given number.
Click to reveal answer
beginner
Explain the FLOOR function in PostgreSQL.
The FLOOR function returns the largest integer less than or equal to the given number.
Click to reveal answer
beginner
What is the purpose of the ABS function in PostgreSQL?
The ABS function returns the absolute value of a number, which means it removes any negative sign and returns a positive number or zero.
Click to reveal answer
beginner
Which function would you use to round 3.14159 to 2 decimal places in PostgreSQL?
You would use ROUND(3.14159, 2) which returns 3.14.
Click to reveal answer
What does CEIL(4.3) return in PostgreSQL?
A5
B3
C4.3
D4
Which function returns the largest integer less than or equal to a number?
AROUND
BCEIL
CABS
DFLOOR
What is the result of ABS(-7) in PostgreSQL?
A7
B-7
C0
D-1
How does ROUND(5.678, 1) evaluate?
A6
B5.6
C5.7
D5
Which function would you use to get the integer part of 9.99 by rounding down?
AROUND
BFLOOR
CCEIL
DABS
Describe the difference between CEIL and FLOOR functions in PostgreSQL.
Think about rounding numbers up or down.
You got /3 concepts.
    Explain how you would use the ROUND function to round a number to 3 decimal places.
    ROUND(number, decimal_places)
    You got /3 concepts.