title: SQL Populate a new table from a query
body: <p>​Hi Guys, I am really new to sql so i am sorry if this sounds stupid.</p>
  <p>I have a query that shows me all the female drivers from two tables (employee and role each table has 1000 rows in total)</p>
  <p><strong>employee table</strong></p>
  <pre><code>    1   Brendon Hayford     Male
      2   Appolonia   Mawer   Female
      3   Stanly  Loachhead   Male
      4   Kinny   Hulcoop     Male
      5   Alyssa  Vose        Female
      6   Gerrie  Cradey      Female
      7   Katalin Coverly     Female
      8   Michelina   Yukhov  Female
      9   Abbey   Thunnerclif Male
      10  Skippy  Juett       Male
      11  Kizzee  Bleythin    Female
      12  Shea    Coxhell     Male
      13  Win Shilstone       Male
      14  Carita  Giddy       Female
      15  Tiebout Creffield   Male
  </code></pre>
  <p><strong>role table</strong></p>
  <pre><code>1   Mechanic
  2   Admin
  3   Mechanic
  4   Admin
  5   Admin
  6   Mechanic
  7   Driver
  8   Mechanic
  9   Admin
  10  Driver
  11  Admin
  12  Driver
  13  Admin
  14  Mechanic
  15  Mechanic
  </code></pre>
  <p><strong>Query</strong></p>
  <pre><code>SELECT role.idrole, employee.*, role.role 
  FROM employee 
  INNER JOIN role 
  ON idrole=idemployee 
  WHERE role.role=&quot;Driver&quot; 
  AND employee.gender=&quot;Female&quot;;
  </code></pre>
  <p>this query return 161 rows of female drivers.</p>
  <pre><code>7   7   Katalin Coverly     Female  Driver
  26  26  Jenilee Soeiro      Female  Driver
  34  34  Rachel  Tourner     Female  Driver
  46  46  Joanne  McCallister Female  Driver
  47  47  Maure   Wingrove    Female  Driver
  63  63  Bettina Mattecot    Female  Driver
  74  74  Nelle   MacRierie   Female  Driver
  77  77  Elsinore    Milius  Female  Driver
  80  80  Emalia  Hellewell   Female  Driver
  82  82  Kerianne    Pirkis  Female  Driver
  95  95  Teena   Pesak       Female  Driver
  99  99  Harriot Seyffert    Female  Driver
  </code></pre>
  <p>I need a way to assign every 2 female drivers from this query to a team (example row 1 and row 2 are in team A row 3 and row 4 Team B etc)</p>
  <pre><code>7   7   Katalin Coverly     Female  Driver Team A
  26  26  Jenilee Soeiro      Female  Driver Team A
  34  34  Rachel  Tourner     Female  Driver Team B
  46  46  Joanne  McCallister Female  Driver Team B
  47  47  Maure   Wingrove    Female  Driver Team C
  63  63  Bettina Mattecot    Female  Driver Team C
  74  74  Nelle   MacRierie   Female  Driver Team D
  77  77  Elsinore    Milius  Female  Driver Team D
  80  80  Emalia  Hellewell   Female  Driver Team E
  82  82  Kerianne    Pirkis  Female  Driver Team E
  95  95  Teena   Pesak       Female  Driver Team F
  99  99  Harriot Seyffert    Female  Driver Team F...
  </code></pre>
  <p>any info or advice will be much appreciated.</p>