Question: 5. Write and run an SQL query that retrieves all the matching rows in the employees table and departments table with the same department ID.

5. Write and run an SQL query that retrieves all the matching rows in the employees table and departments table with the same department ID. We also want all the rows from the DEPARTMENTS table, even if there isnt a match from the EMPLOYEES table. Also, we only want those departments that start with the letter P.
Human Resources [HRI Schema LOCATIONS location id street address postal code city state province Country id DEPARTMENTS department id manager id location id JOB HISTORY employee id .EMPLOYEES start date end date job id employee id first name ast name email phone_number hire date job_id salary commission pct manager id department id COUNTRIES country id country_name region_id department id JOBS job id job title min salary max_salary REGIONS region id region name
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
