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
Tak for dine kommentarer!
single
Challenge: Complex Assignment Matching
Stryg for at vise menuen
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
Løsning
Tak for dine kommentarer!
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat