Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Complex Assignment Matching | Section
SQL Joins in Depth
Section 1. Chapter 12
single

single

bookChallenge: Complex Assignment Matching

Swipe to show menu

Task

Swipe to start coding

Write a SQL query that joins four tables to produce a full assignment report.

Table relationships:

  • assignments.employee_idemployees.employee_id

  • assignments.project_idprojects.project_id

  • projects.department_iddepartments.department_id

  • Start your query from the assignments table

  • Perform 3 consecutive JOINs in the following order:

    1. assignmentsemployees
    2. assignmentsprojects
    3. projectsdepartments
  • Return exactly four columns with these aliases:

    • assignment_id — from assignments
    • employee_name — from employees.name
    • project_name — from projects
    • department_name — from departments
  • Use table.column notation when referencing all columns

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 12
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt