VR Startup Company - Q4

Exercise

Hello! I have a question about Question 4 in the VR Startup Company exercise. The prompt is to list the names of projects that were not chosen by any employees. My code is:

I don’t understand why the code needs the “WHERE current_project IS NOT NULL” statement to run correctly. There are no null values for project_id, so why does it matter if null is included in the list of values that the project ids are being compared against? The code does not run at all without that statement.

I was also wondering if there is a log somewhere that I’m missing, that would really be helpful… Thanks for the help!

The solution is essentially worked backwards. This code is doing two things:

  1. The first WHERE clause is finding all of the projects that have been taken by an employee. The WHERE current_project IS NOT NULL clause is finding all of the projects which have an employee; the IS NOT NULL makes sure only the projects that are being worked on are selected.
  2. All the projects which do not meet the above description are the selected (WHERE project_id NOT IN…); all the projects which have not been chosen by an employee.

I hope this helps!