Write a SQL query that joins four tables to produce a full assignment report.
Table relationships:
-
assignments.employee_id→employees.employee_id -
assignments.project_id→projects.project_id -
projects.department_id→departments.department_id -
Start your query from the
assignmentstable -
Perform 3 consecutive
JOINs in the following order:assignments→employeesassignments→projectsprojects→departments
-
Return exactly four columns with these aliases:
assignment_id— fromassignmentsemployee_name— fromemployees.nameproject_name— fromprojectsdepartment_name— fromdepartments
-
Use
table.columnnotation when referencing all columns
Thanks for your feedback!
single
Challenge: Complex Assignment Matching
Swipe to show menu
Swipe to start coding
Write a SQL query that joins four tables to produce a full assignment report.
Table relationships:
-
assignments.employee_id→employees.employee_id -
assignments.project_id→projects.project_id -
projects.department_id→departments.department_id -
Start your query from the
assignmentstable -
Perform 3 consecutive
JOINs in the following order:assignments→employeesassignments→projectsprojects→departments
-
Return exactly four columns with these aliases:
assignment_id— fromassignmentsemployee_name— fromemployees.nameproject_name— fromprojectsdepartment_name— fromdepartments
-
Use
table.columnnotation when referencing all columns
Solution
Thanks for your feedback!
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat