Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The task is to display a department and its employees’ details. In this case, we

ID: 3913416 • Letter: T

Question

The task is to display a department and its employees’ details. In this case, we are required to join DEPARTMENTS and EMPLOYEES tables as following:

select d.department_id Department_id,

d.department_name department_name,

d.manager_id manager_id,

e.employee_id employee_id,

e.first_name || ' ' || e.last_name full_name

from departments d, employees e

where e.department_id = e.department_id;

As a step, I would recommend that you check to see if the SQL statement runs correctly. So go ahead and run it in SQL Developer as follows:

You will see the following results of the table:

Part 1 Question

Write a SQL statement to find out details of countries and its locations.

HR Worksheet Query Builder alselect d.department id d.department name d.manager_id e.employee_id e.first_name ''11 e.last_name full_name Department_id, department_name, manager_id, employee_id, from departments d, employees e wheree.department_id - e.department_id; Query Result ?? EE2 Ek SQL | Fetched 50 rows in 0.016 seconds DEPARTMENTIDDEPARTMENT NAMEMANAGER IDEMPLOYEE_IDFULL_NAME 10 Administration 10 Administration 10 Administration 10 Administration 10 Administration 10 Administration 10 Administration 10 Administration 200 200 200 200 200 200 200 200 200 Jennifer Whaler 201 Michael Hartstein 202 Pat Fay 114 Den Raphaely 115 Alexander Khoo 116 Shelli Baida 117 Sigal Tobias 118 Guy Himuro

Explanation / Answer

Answer)

select d.department_id Department_id,

d.department_name department_name,

d.manager_id manager_id,

e.employee_id employee_id,

e.first_name || ' ' || e.last_name full_name

from departments d, employees e

where e.department_id = e.department_id;

-- You have not shared the structures of the tables or the data in it. As far as I understand, we need to join the tables departments and employees using SQL join to display the Department_id, department_name, manager_id, employee_id, first_name and last_name from the joined tables.

There is a slight error in the above SQL which I will correct below:

select d.department_id Department_id,

d.department_name department_name,

d.manager_id manager_id,

e.employee_id employee_id,

e.first_name || ' ' || e.last_name full_name

from departments d, employees e

where d.department_id = e.department_id;

The above query will successfully join the two tables and give out the required output displaying the info required.

Part 1 Question)

There is no information about the table structure to find out details of countries and its locations. Table structure is required for solving that.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote