create table id_table (
id int(11) unsigned,
PRIMARY KEY (id)
);
create table reference_TABLE (
fk_id int(11) unsigned,
ref_name varchar(100),
PRIMARY KEY (fk_id,ref_name),
FOREIGN KEY (fk_id) REFERENCES id_table (id)
);
Content of tables:
1) Table:id_table has 100 entries
1
2
3
...
100
2) Table:reference_TABLE is empty
Now i want to insert in to reference_TABLE with reference name newbie,each id from id_table.
As we can see above we have 100 entries in id_table. Should i write 100 'inset into' statements to fill reference_TABLE or is there any other short cut to achieve this.
-Thanks