My site's users take tests, and their responses are recorded in a "response" table. Here are the relevant tables:
User
userID
Test
testID
Response
responseID
testID
userID
I'm trying to create a query that will return all of the DB's testIDs, and indicate if a given userID has taken them. For tests not taken by a user, NULLs will be returned.
Let's say that the DB contains six tests, numbered 1-6. User #4 has taken every test, except for numbers 4 and 5, so there would be responseIDs linking userID #4 to those testIDs. Is there a simple way to get what's depicted in the attached image, without having to turn to temporary tables or other complex solutions?