Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
4. Filtering – exercise
Dictionary database
Summary

Instruction

Good! How about a little exercise on filtering?

Exercise

Show the name of the apprentice, their specialization and the ID of the project if the project they are working on is not directly supervised by their master, i.e. the master currently works on another project.

Stuck? Here's a hint!

Type:

SELECT
  Apprentice.Name,
  Apprentice.Specialization,
  Apprentice.ProjectId
FROM WorkshopWorkers Apprentice
JOIN WorkshopWorkers Master
  ON Apprentice.MasterId = Master.Id
WHERE Apprentice.ProjectId != Master.ProjectId