SQL Assignment #5. YejiKim
SQL Assignment #5. YejiKim
1. The HR department needs a query that displays the last name, hire date, and department ID
of any employee in the same department as the employee with the last name of Hall.
SELECT last_name, hire_date, department_id
FROM HR.EMPLOYEES
WHERE department_id =
(SELECT department_id
FROM HR.EMPLOYEES
WHERE last_name = 'Hall');
2. Create a report that displays the employee number, last name, and salary of all employees
who earn more than the average salary of the entire company.
SELECT employee_id, last_name, salary
FROM HR.EMPLOYEES
WHERE salary >
(SELECT AVG(salary)
FROM HR.EMPLOYEES);
4. This is what we went through at the end of class…Create an SQL query (subquery) to display the
first name, last name, and salary of all employees that have a salary that is greater than the salary of all
employees that have the job_id of ST_MAN.
Now, you need to create the outer query and focus on using the correct operator.