Course Content
Intermediate SQL
Intermediate SQL
Employees With More Than Average Salary Challenge
I mentioned earlier that when a subquery is written in the WHERE
section, we can use the IN
operator and comparison operators
.
For example, like this:
Following a similar algorithm, you'll need to complete the following task.
We'll be working with the employees
table, which looks like this:
Task
Find employees whose salary
is above the average salary of all employees using a subquery in the WHERE
section.
The resulting table should have 3 columns: first_name
, last_name
, and salary
. Then, sort the result by salary from highest to lowest using ORDER BY
.
Task
Find employees whose salary
is above the average salary of all employees using a subquery in the WHERE
section.
The resulting table should have 3 columns: first_name
, last_name
, and salary
. Then, sort the result by salary from highest to lowest using ORDER BY
.
Note
This syntax can be used as a great alternative to the
HAVING
clause.
Everything was clear?
Employees With More Than Average Salary Challenge
I mentioned earlier that when a subquery is written in the WHERE
section, we can use the IN
operator and comparison operators
.
For example, like this:
Following a similar algorithm, you'll need to complete the following task.
We'll be working with the employees
table, which looks like this:
Task
Find employees whose salary
is above the average salary of all employees using a subquery in the WHERE
section.
The resulting table should have 3 columns: first_name
, last_name
, and salary
. Then, sort the result by salary from highest to lowest using ORDER BY
.
Task
Find employees whose salary
is above the average salary of all employees using a subquery in the WHERE
section.
The resulting table should have 3 columns: first_name
, last_name
, and salary
. Then, sort the result by salary from highest to lowest using ORDER BY
.
Note
This syntax can be used as a great alternative to the
HAVING
clause.
Everything was clear?
Employees With More Than Average Salary Challenge
I mentioned earlier that when a subquery is written in the WHERE
section, we can use the IN
operator and comparison operators
.
For example, like this:
Following a similar algorithm, you'll need to complete the following task.
We'll be working with the employees
table, which looks like this:
Task
Find employees whose salary
is above the average salary of all employees using a subquery in the WHERE
section.
The resulting table should have 3 columns: first_name
, last_name
, and salary
. Then, sort the result by salary from highest to lowest using ORDER BY
.
Task
Find employees whose salary
is above the average salary of all employees using a subquery in the WHERE
section.
The resulting table should have 3 columns: first_name
, last_name
, and salary
. Then, sort the result by salary from highest to lowest using ORDER BY
.
Note
This syntax can be used as a great alternative to the
HAVING
clause.
Everything was clear?
I mentioned earlier that when a subquery is written in the WHERE
section, we can use the IN
operator and comparison operators
.
For example, like this:
Following a similar algorithm, you'll need to complete the following task.
We'll be working with the employees
table, which looks like this:
Task
Find employees whose salary
is above the average salary of all employees using a subquery in the WHERE
section.
The resulting table should have 3 columns: first_name
, last_name
, and salary
. Then, sort the result by salary from highest to lowest using ORDER BY
.
Note
This syntax can be used as a great alternative to the
HAVING
clause.