title: Insert a row to some tables with same id
body: <p>I need to insert an entity to more than one tables. Number of row in tables is not equal but I need to fetch that entity by its id from all the tables. In oracle we can use same sequence for all these tables but what can we do in the mysql to do such thing? (I can’t use foreign key or use last inserted id because each entity insert row in some tables, not all of them and there’s no sequence in inserting into them.)
  Something like this:</p>
  
  <p>Entities:</p>
  
  <p>E1: a1,a2,a3,a4,a5,a6</p>
  
  <p>E2:b1,b2,b3,b4,b5</p>
  
  <p>E3:c1,c2,c3,c4,c5</p>
  
  <p>E4:d1,d2,d3,d4,d5,d6</p>
  
  <p>Table1:</p>
  
  <pre><code>  Id  | col1 | col2
     5    a1      a2
     3    c1      c2
  </code></pre>
  
  <p>Table2:</p>
  
  <pre><code> Id  | col1 | col2
    1     b3     b4
    4     d3     d4
    5     a3     a4
  </code></pre>
  
  <p>Table3: </p>
  
  <pre><code>  Id  | col1 | col2
     4     b5     b6
     5     a5     a6
  </code></pre>
  
  <p>Then I can join tables and fetch E1 by id=5</p>