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.

Using aggregate functions

Using aggregate functions - Oracle Database Tutorial

From the course: Oracle Database 12c: Basic SQL

Start my 1-month free trial

Using aggregate functions

- [Instructor] Using SQL queries, with aggregate functions in Oracle is quite straightforward. Let's see a simple example in action before we go into the more advance use cases in our next videos. So we start by selecting the top earning employee in our company. To accomplish that, all we have to do is type select max(salary) from employees executing this query will give us back one output, the highest salary out of all employees in our company. I can also add additional aggregate functions to my query. For example, min(salary) and avg(salary). Producing a result set showing us the highest salary in our company, the lowest salary in our company and the average salary, which is as you can see, a very very precise value. We can round the average salary value by nesting the averge function inside a round function, producing a much more readable output. I can also use the count function to see how many employees I have in my company in total. So select count(*) from employees. I see that…

Contents