CodeBlanks Logo Icon CodeBlanks

Summary - Number functions

Combine ROUND, ABS and MOD to do calculations.

Summary - Number functions

In this group you learned ROUND, CEIL, FLOOR, ABS, POWER, SQRT and MOD. Choosing the right function matters in calculations.

SELECT ROUND(SQRT(16), 0) AS sonuc;

This query takes the square root of 16 and rounds to an integer.

The expression ROUND(SQRT(16), 0) AS sonuc is evaluated and returned.

Practice Summary - Number functions

Select the square root of price aliased as kok from products.

Starter code

query.sql
-- summary calc
SELECT
FROM products

Sample solution

query.sql
SELECT SQRT(price) AS kok
FROM products

Expected output

kok
2.24
3.54

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 Which rounds up?

  • FLOOR
  • MOD
  • CEIL Correct answer
  • ABS

Explanation: CEIL always rounds up.

2 Summary - Number functions: match the terms

Term Meaning
ROUND round
CEIL up
FLOOR down
ABS absolute

All lessons in Beginner