SQL Join Assignment
SQL Join Assignment
,deptno)
1. Write a query to display the last name, department number, and department name for all
employees.
2. Create a unique listing of all jobs that are in department 80. Include the location of the
department in the output.
3. Write a query to display the employee last name, department name, location ID, and city of all
employees who earn a commission.
4. Display the employee last name and department name for all employees who have an a
(lowercase) in their last names. Place your SQL statement in a text file named lab4_4.sql.
5. Write a query to display the last name, job, department number, and department name for all
employees who work in Toronto.
6. Display the employee last name and employee number along with their manager’s last name and
manager number. Label the columns Employee, Emp#, Manager, and Mgr#, respectively. Place
your SQL statement in a text file named lab4_6.sql.
7. Modify lab4_6.sql to display all employees including King, who has no manager. Order the
results by the employee number. place your SQL statement in a text file named lab4_7.sql. Run
the query in lab4_7.sql.
8. Create a query that displays employee last names, department numbers, and all the employees
who work in the same department as a given employee. Give each column an appropriate label.
9. Show the structure of the JOB_GRADES table. Create a query that displays the name, job,
department name, salary, and grade for all employees.
10. Create a query to display the name and hire date of any employee hired after employee Davies.
11. Display the names and hire dates for all employees who were hired before their managers, along
with their manager’s names and hire dates. Label the columns Employee, Emp Hired, Manager,
and Mgr Hired, respectively.