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 - Oracle Database Tutorial
From the course: Oracle Database 12c: Basic SQL
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Writing your first SELECT query1m 56s
-
(Locked)
Selecting only specific columns2m 22s
-
(Locked)
Using WHERE to filter specific rows1m 55s
-
(Locked)
Using multiple WHERE conditions3m 55s
-
(Locked)
Using WHERE to filter partial strings3m 12s
-
(Locked)
Using WHERE to filter numeric ranges1m 17s
-
(Locked)
Using WHERE IN and NOT IN for strings1m 54s
-
(Locked)
Using WHERE IN and NOT IN for numbers1m 35s
-
(Locked)
Using WHERE to filter dates2m 42s
-
(Locked)
Using WHERE to filter exact strings1m 55s
-
(Locked)
Using DISTINCT to eliminate duplicates4m
-
(Locked)
Performing basic numeric calculations2m 23s
-
(Locked)
Using column aliases2m 18s
-
(Locked)
Describe the structure of a table3m 16s
-
(Locked)
Using ORDER BY3m 29s
-
-
-
-
-
-
-