From the course: Oracle Database 12c: Basic SQL

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Performing basic numeric calculations

Performing basic numeric calculations - Oracle Database Tutorial

From the course: Oracle Database 12c: Basic SQL

Start my 1-month free trial

Performing basic numeric calculations

- [Instructor] You can also perform simple calculations as part of your SQL query. For example, let's select the first_name, last_name, and salary of all of the employees in our employees table. Let's say this year was a very good year for our company in terms of revenue, and the CEO has decided to give all employees a raise of 15%. Man, I wish I worked for that company. So in order to predict the new salaries for the employees, following the raise, we can just type comma, salary, which is the name of the salary column from our table, and multiply it by 1.15. Running the query will show us the new salary value for all employees after the 15% bonus has taken effect. Note that we use the star character for doing multiplications in our query. We can also add additional calculations. For example, let's say that in addition to viewing the current salary, and the projected new salary after the bonus, we also want to see the absolute bonus value itself. So we can type comma, salary times…

Contents