Question: SO I have two table connecting each other

```
TABLE Admin_Evaluate
EvalID int primary key,
EvalStatus tinyint,
UserID int (foreign to user)

TABLE Items
ItemID int primary key,
EvalID (foreign to Admin_Evalulate)

Sample Data:

| TABLE Admin Evaluate |
 ---------------------------------------------
 EvalID | EvalStatus | UserID
   1         0           5
   2         1           5
   3         0           5
   4         1           5
   5         1           5
   6         1           5

 | TABLE Items |
 ----------------------------------------------
 ItemID  | EvalID 
   1         2
   2         4

```

So basically I want to retrieve the **EvalID** where EvalStatus = 1 and UserID = 5 AND **DOESN'T EXISTS** in the **Table Items**

The results should be **EvalID 5 and 6**

Thanks in advance :)

Answer: 
You can use `NOT EXISTS`:

```sql
SELECT EvalID
FROM Admin_Evaluate AS a
WHERE EvalStatus = 1 AND UserID = 5 AND 
      NOT EXISTS (SELECT 1 FROM Items AS i WHERE i.EvalID = a.EvalID)

```
You can use Left join :

```
SELECT * FROM Admin_Evaluate a LEFT JOIN Items i ON i.EvalId = a.EvalId WHERE EvalStatus = 1 AND UserID = 5 AND i.EvalId is NULL;

```