Computer Science > QUESTIONS & ANSWERS > Strayer University, Washington - CIS 276Week 4 Assignment Practice 6 and 7 (All)
David Grof Practice 6 1. The HR department needs a query that prompts the user for an employee last name. The query then displays the last name and hire date of any employee in the same department ... as the employee whose name they supply (excluding that employee). For example, if the user enters Zlotkey, find all employees who work with Zlotkey (excluding Zlotkey). a. SELECT last_name, hire_date FROM employees WHERE department_id = (SELECT department_id FROM employees WHERE last_name = '&&Enter_name') AND last_name <> '&Enter_name'; 2. Create a report that displays the employee number, last name, and salary of all employees who earn more than the average salary. Sort the results in order of ascending salary. a. SELECT employee_id, last_name, salary FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) ORDER BY salary; 3. Write a query that displays the employee number and last name of all employees who work in a department with any employee whose last name contains a u. Place your SQL statement in a text file named lab_06_03.sql. Run your query. a. SELECT employee_id, last_name FROM employees WHERE department_id IN (SELECT department_id FROM employees WHERE last_name like '%u%'); [Show More]
Last updated: 1 year ago
Preview 1 out of 8 pages
Instant download
Instant download
Connected school, study & course
About the document
Uploaded On
Apr 15, 2021
Number of pages
8
Written in
This document has been written for:
Uploaded
Apr 15, 2021
Downloads
0
Views
32
In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Browsegrades · High quality services·