Question: I have the following tables:

```
Contacts
      contact_id, contact_name, etc.
assigned_lists
      contact_id, list_id

```

Each contact can be associated with more than 1 list, which is stored in the `assigned_lists` column. 

I have a lot of contacts who are not associated with any lists. How would I insert all the `contact_id`'s that are not associated with a list into `assigned_lists`?

Answer: 
Try with:

```
INSERT INTO assigned_lists (contact_id, list_id)
SELECT contact_id, 24
FROM Contacts
WHERE contact_id NOT IN (
  SELECT DISTINCT contact_id
  FROM assigned_lists
)

```
```
INSERT INTO assigned_lists (contact_id, list_id)
SELECT contact_id, @yourNewListID
FROM Contacts
WHERE contact_id NOT IN (SELECT contact_id FROM assigned_lists)

```

SQL Fiddle Example: <http://sqlfiddle.com/#!3/d59d1e/1>