Assuming table A has ID(int) as PK, i want to write a script which inserts all rows from table B to table A(both have matching columns) and puts IDs of inserted rows in table C (just keeps IDs). Feel free to design columns as required for A, B, C (go with minimum number of columns)