Question: I have a an application with interns who can apply to internships.
We have a script that automatically qualifies the interns.
I would like to fetch all interns who aren't qualified to any internship.

The database is like this :

```
 Intern (Id,...)
 Application (Id, status, intern_id, internship_id,...)
 Internship (Id,...)

```

For the status, we have 'applied', 'qualified', 'current' and 'done'
Basically I need to do a join request of Interns who don't have Application with 'qualified' status, but my sql skills are pretty basic.

**EDIT**

I forgot to mention that there can be several applications for an intern, an intern can only be qualified to one internship, but he can still be applying to another, so this won't work

```
SELECT *
FROM Intern i
INNER JOIN Application a ON i.Id = a.intern_id
WHERE a.status <> 'qualified'

```

Answer: 
Include the status in a `LEFT JOIN`, and filter for non-matches like so:

```
SELECT  ....
FROM    Intern i
        LEFT JOIN
                Application a
                ON i.Id = a.intern_id
                AND a.status = 'qualified'
WHERE   a.Id IS NULL

```

Substitute your list of columns, obviously!
```
SELECT *
  FROM Intern i
 WHERE NOT EXISTS
    (SELECT *
       FROM Intern j
          , Application a
      WHERE j.id = a.intern_id
        AND i.id = j.id
        AND a.status = 'qualified')

```