From the course: Complete Guide to SQL for Data Engineering: from Beginner to Advanced

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Using mathematical functions

Using mathematical functions

- [Instructor] Mathematical function in SQL are like magical tools that help you perform various calculation on numeric data. Some of the most common numerical functions are like, ABS, CEIL, FLOOR, ROUND, SQRT. Let's just get down to our pgAdmin, and see how we can use all of them. For example, let's start with absolute. I said select abs, and I pass a value, let's say call, 2.6. Now, if I execute this, I will get a output 2.6. This output is nothing but a positive number. Remember, absolute is trying to give you the positive value or the absolute value of a number. Whether the number is negative or positive with absolute, you always get the positive value. Even if I run this with select absolute 2.6, I will get the positive result only. Similarly, let's say for example, if I want to know the ceiling, so I say ceil(2.3). So ceil is basically try to find out the maximum or the higher integer nearby this number. 2.3 ceil…

Contents