Write a query to display the employees name and hire date for all employees in t
ID: 3732527 • Letter: W
Question
Write a query to display the employees name and hire date for all employees in the same department as 'Blake'. Exclude 'Blake'.
Create a query to display the employee number and name for all employees who earn more than the average salary. Sort the results in descending order of salary.
Write a query that will display the employee number and name for all employees who work in a department with any employee whose name contains a 'T'.
Display the employee name, department number, and job title for all employees whose department location is Dallas.
Display the employee name and salary of all employees who report to 'King'.
Display the department number, name, and job for all employees in the Sales department.
Display the employee number, name, and salary for all employees who earn more than the average salary and who work in a department with any employee with a 'T' in their name.
Explanation / Answer
1.select employee_name, hire_date FROM employees WHERE department_no = ( SELECT department_no FROM employees WHERE employee_name = 'Blake') AND employee_name <> 'Blake';
2. select employee_number, employee_name FROM employees WHERE salary > ( select AVG(salary) FROM employees ) ORDER BY salary DESC;
3.select employee_number, employee_name FROM employees WHERE department_no IN ( SELECT department_no FROM employees WHERE employee_name LIKE '%T%');
4. select employee_name, department_no, job _title from employees where department.department_no=employees.department_no and department_location = (select location from department where location = 'Dallas');
5. select employee_name, salary from employees where manager_id in (select employee_number from employees where last_name='King');
6. select department_no, employee_name, job_id from employees where department_no in (select department_no from department where department_name = 'Sales');
7. select employee_number, employee_name , salary FROM employees WHERE salary > (SELECT AVG (salary) FROM employees ) AND department_id IN ( SELECT department_id FROM employees
WHERE employee_name LIKE '%T%');
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.