Why am I getting NULL values on Left Join?
<p>I'm migrating a database a new one to change One-to-Many relationships to Many-to-Many (and to improve the column naming scheme). [Edit: I've created a <a href="http://sqlfiddle.com/#!9/b98c69/3" rel="nofollow noreferrer">SQLFiddle</a> for this.]</p>

<pre><code>oldDB                           newDB
=========================       =======================================
individuals                     people
 - individual_id                 - id
 - individual_name_first         - first_name
 - individual_name_last          - last_name
 - individual_name_other         - additional_identifier
 - individual_position           - role
 - individual_group_code         - (replaced with people-groups table)
(There are duplicate rows
 in this table for individ's
 who are in more than one
 group.)

groups                          groups
 - (no id in oldDB)              - id
 - group_code                    - short_name
 - group_name                    - full_name

                                people_groups
                                 - id
                                 - person_id
                                 - group_id
                                 - start_date
                                 - end_date
</code></pre>

<p>Specifically, I'm having trouble with creating the linking table between <code>people</code> and <code>groups</code>.</p>

<p>I've already created the <code>people</code> and <code>groups</code> tables:</p>

<pre><code>CREATE TABLE IF NOT EXISTS people (
  id int(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
  first_name varchar(50) NOT NULL,
  last_name varchar(50) NOT NULL,
  additional_identifier varchar(50) DEFAULT NULL COMMENT 'In case of duplicate first and last names',
  role varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

ALTER TABLE newDB.people ADD UNIQUE `name` (last_name, first_name, additional_identifier);

INSERT INTO newDB.people
  (id, first_name, last_name, role)
SELECT
  individual_id, individual_name_last, individual_name_first, individual_position, COUNT(*)
FROM
  oldDB.individuals
GROUP BY
  individual_name_last, individual_name_first;

CREATE TABLE IF NOT EXISTS newDB.groups(
    id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    full_name VARCHAR(255) NOT NULL UNIQUE,
    short_name VARCHAR(255) NOT NULL UNIQUE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO newDB.groups
  (full_name, short_name)
SELECT
  group_name, group_code
FROM
  oldDB.groups;
</code></pre>

<p>Next I will <code>CREATE</code> the <code>newDB.people-groups</code> table, but first I'm making sure I can <code>SELECT</code> the right values:</p>

<pre><code>SELECT
  newDB.groups.id 'group id',
  newDB.people.id 'person id',
  individual_group_code 'group short name',
  individual_name_last 'last name',
  individual_name_first 'first name'
FROM
  oldDB.individuals
LEFT JOIN
  newDB.groups ON(
    newDB.groups.short_name = oldDB.individuals.individual_group_code
   )
LEFT JOIN newDB.people ON (
  newDB.people.last_name = oldDB.individuals.individual_name_last 
    AND
  newDB.people.first_name = oldDB.individuals.individual_name_first
)
GROUP BY
  individual_name_last ASC,
  individual_name_first ASC,
  individual_group_code
</code></pre>

<p>The first <code>LEFT JOIN</code> is just for displaying the group short names for easy verification. <strong>The second <code>LEFT JOIN</code> is important: it is supposed to allow for the <code>'person id'</code> output to be pulled from <code>newDB.people.id</code>. Instead, I'm just getting NULL in that column for all rows of output.</strong> Everything else is displaying correctly. What am I missing?</p>

<h1>Edit:</h1>

<h2>Desired output</h2>

<p>Here is what I am hoping to get. (I generated it by replacing <code>newDB.people.id 'person id'</code> with <code>oldDB.individuals.individual_id 'person id'</code>. To exemplify the problem with it is that person 925 and 1232 are the same person in two different groups. The new database simplifies that to having person 925.)
<a href="https://i.stack.imgur.com/JsVbT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JsVbT.png" alt="This is the desired output"></a></p>

<h2>Actual output</h2>

<p>Here is what I am getting:
<a href="https://i.stack.imgur.com/Top28.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Top28.png" alt="The out put with nulls"></a></p>

<h1>Edit 2:</h1>

<p><a href="http://sqlfiddle.com/#!9/b98c69/3" rel="nofollow noreferrer">Here</a> is a SQLFiddle that <em>does</em> work. Why doesn't it work in my phpmyadmin?</p>