224k views
0 votes
6. Create a SQL query that for the employee Nathan Geller will identify the projects he’s associated with. List the project ID, employee ID, employee last name and project start date for all projects whose assigned employee’s last name is Geller

1 Answer

4 votes

Answer:

This query uses a JOIN operation to combine the "projects" and "employees" tables based on the "employee_id" foreign key. The WHERE clause filters the results to only include projects where the assigned employee's last name is "Geller" and first name is "Nathan". The SELECT clause specifies which columns to include in the output: "project_id" from the "projects" table, "employee_id" and "last_name" from the "employees" table, and "start_date" from the "projects" table.

SQL Query

SELECT projects.project_id, employees.employee_id, employees.last_name, projects.start_date

FROM projects

JOIN employees ON projects.employee_id = employees.employee_id

WHERE employees.last_name = 'Geller' AND employees.first_name = 'Nathan';

User Antony Hutchison
by
7.3k points