title: Move data from parent table (A) and its child table (B) to parent table (C) and its child table (D) - Mysql
body: <p>I am having trouble writing query or procedure. My requirement is I want to move data from table A and its child table B to new parent table (C) and its child table (D) with same structure. </p>
  
  <p>Primary key column in table A is inserted into one of the column in table B for reference. The challege I have is when I move from Parent table A to new parent table C , new primary key will generated. I want to insert that newly generated key into table D with corresponding rows when I move the data from child table B to new child table D. </p>
  
  <p>It might be simply procedure or query to someone. But i am not able to figureout . Need some help!</p>