title: MySQL ON DUPLICATE insert into another table
body: <p>I have the following problem:
  Every author has a name and n-aliases for this name. Every alias comes from a source. Every alias has m sources. For example</p>
  
  <pre><code>AUTHOR| ALIAS | SOURCE
  -------------------------
  Will| Willy |George
  Will| Bill  | Jenny
  William| Will|  Francis
  William| Bill| Maya
  </code></pre>
  
  <p>I have one table for the author and his name, one for all of his aliases:</p>
  
  <pre><code>CREATE TABLE alias (
      authors_id INT NOT NULL,
      alias VARCHAR(150) NOT NULL,
      id INT NOT NULL AUTO_INCREMENT
      PRIMARY KEY (author_id,alias);
  </code></pre>
  
  <p>id serves as foreign key.
  Here's the second table for the sources </p>
  
  <pre><code>CREATE TABLE alias_source (
      id INT NOT NULL AUTO_INCREMENT
      source VARCHAR(150) NOT NULL,
      alias_id INT NOT NULL,
      PRIMARY KEY (id)
      FOREIGN KEY (alias_id) REFERENCES alias(id);
  </code></pre>
  
  <p>Now I need an MySQL insert statement for when I insert 
  author,alias,source into alias that the source is inserted into alias_source.
  And on duplicate alias no only a new source is added.</p>